Sha256: 1c7cd23267208e0b7b0e975200da8ce0a37caa758aa9db460760ee695ba211ba
Contents?: true
Size: 1.16 KB
Versions: 14
Compression:
Stored size: 1.16 KB
Contents
# Author: Brandon Mathis # Description: Provides plugins with a method for wrapping and unwrapping input to prevent Markdown and Textile from parsing it. # Purpose: This is useful for preventing Markdown and Textile from being too aggressive and incorrectly parsing in-line HTML. module TemplateWrapper # Wrap input with a <div> def safe_wrap(input) "<div class='bogus-wrapper'><notextile>#{input}</notextile></div>" end # This must be applied after the def unwrap(input) input.gsub /<div class='bogus-wrapper'><notextile>(.+?)<\/notextile><\/div>/m do $1 end end end # Author: phaer, https://github.com/phaer # Source: https://gist.github.com/1020852 # Description: Raw tag for jekyll. Keeps liquid from parsing text betweeen {% raw %} and {% endraw %} module Jekyll class RawTag < Liquid::Block def parse(tokens) @nodelist ||= [] @nodelist.clear while token = tokens.shift if token =~ FullToken if block_delimiter == $1 end_tag return end end @nodelist << token if not token.empty? end end end end Liquid::Template.register_tag('raw', Jekyll::RawTag)
Version data entries
14 entries across 14 versions & 1 rubygems