Skip to content

Instantly share code, notes, and snippets.

@zavakid
Created November 9, 2012 13:24
Show Gist options
  • Save zavakid/4045648 to your computer and use it in GitHub Desktop.
Save zavakid/4045648 to your computer and use it in GitHub Desktop.
liquid tokenize
text = "{{asd}} sdfadsf afas {% a %}xxx{% enda %} asdfa asdf s af "
text.split(Liquid::TemplateParser)
# result:
[
"",
"{{asd}}",
" sdfadsf afas ",
"{% a %}",
"xxx",
"{% enda %}",
" asdfa asdf s af "
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment