Skip to content

Instantly share code, notes, and snippets.

@phaer
Created June 11, 2011 19:11
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save phaer/1020852 to your computer and use it in GitHub Desktop.
Save phaer/1020852 to your computer and use it in GitHub Desktop.
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)
@Stratus3D
Copy link

Turned out Jekyll 3 has the raw tag built in, so this code isn't needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment