mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2025-02-28 08:21:52 -05:00
added raw liquid tag plugin for helping with documentation
This commit is contained in:
parent
8e978596b6
commit
3983bd0918
24
plugins/raw.rb
Normal file
24
plugins/raw.rb
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# 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)
|
Loading…
x
Reference in New Issue
Block a user