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) |
This comment has been minimized.
This comment has been minimized.
marcysutton
commented
Jun 23, 2014
Does this work with Sass in Jekyll 2x? |
This comment has been minimized.
This comment has been minimized.
xoyabc
commented
Jun 20, 2018
<div no-ui-slider
slider-options="{{ optionsWithoutStart }}"
ng-model="sliderPositions"></div> |
This comment has been minimized.
This comment has been minimized.
JonnoFTW
commented
Nov 6, 2018
I get an error using this when trying to run locally:
|
This comment has been minimized.
This comment has been minimized.
Stratus3D
commented
Jun 30, 2019
I get the same error as @JonnoFTW after upgrading to Jekyll 3. My guess is the class name in Jekyll or Liquid changed. |
This comment has been minimized.
This comment has been minimized.
This gist is a bit over 8 years old, which is quite some time in software development. Please take the discussion to liquid and see if it's still supported there. I've long stopped using liquid as well as jekyll myself. |
This comment has been minimized.
This comment has been minimized.
Stratus3D
commented
Jun 30, 2019
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
This comment has been minimized.
phaer commentedJun 13, 2011
titanous added it to shopify's liquid fork and wrote a test for it: https://github.com/Shopify/liquid/blob/4087a94d881c53b803f1d682db7e4676a6f4d714/test/lib/liquid/tags/raw_test.rb
Thanks!