You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
592 B
Ruby
25 lines
592 B
Ruby
14 years ago
|
# 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)
|