Skip to content
Snippets Groups Projects
Commit 59a0a187 authored by Jeanine Adkisson's avatar Jeanine Adkisson
Browse files

Merge pull request #263 from RadLikeWhoa/master

Fix bugs in liquid lexer (closes #237)
parents b29ee3d7 8ad7706f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -131,9 +131,7 @@ module Rouge
groups nil, Operator, Operator::Word
end
 
rule /([\w\.\'"]+)(\s+)(contains)(\s+)([\w\.\'"]+)/ do
groups nil, Text::Whitespace, Operator::Word, Text::Whitespace
end
rule /(contains)/, Operator::Word
 
mixin :generic
mixin :whitespace
Loading
Loading
@@ -168,6 +166,7 @@ module Rouge
# states for unknown markup
state :param_markup do
mixin :whitespace
mixin :string
 
rule /([^\s=:]+)(\s*)(=|:)/ do
groups Name::Attribute, Text::Whitespace, Operator
Loading
Loading
@@ -177,7 +176,6 @@ module Rouge
groups Punctuation, Text::Whitespace, nil, Text::Whitespace, Punctuation
end
 
mixin :string
mixin :number
mixin :keyword
 
Loading
Loading
@@ -196,12 +194,12 @@ module Rouge
end
 
state :tag_markup do
rule (/%\}/) { token Punctuation; reset_stack }
mixin :end_of_block
mixin :default_param_markup
end
 
state :variable_tag_markup do
rule (/%\}/) { token Punctuation; reset_stack }
mixin :end_of_block
mixin :variable_param_markup
end
 
Loading
Loading
@@ -225,7 +223,13 @@ module Rouge
rule /\d+/, Num::Integer
end
 
state :array_index do
rule /\[/, Punctuation
rule /\]/, Punctuation
end
state :generic do
mixin :array_index
mixin :keyword
mixin :string
mixin :variable
Loading
Loading
@@ -258,6 +262,7 @@ module Rouge
 
state :assign do
mixin :whitespace
mixin :end_of_block
 
rule /(\s*)(=)(\s*)/ do
groups Text::Whitespace, Operator, Text::Whitespace
Loading
Loading
Loading
Loading
@@ -58,14 +58,15 @@ Some other {{ output }}!
{% include file.html param = 'value' param2 = object %}
{% include 'snippet' param = 'value' param2 = object %}
 
{% assign page_has_image = false %}
{% assign img_tag = '<' | append: 'img' %}
{% assign page_has_image = false %}
{% assign img_tag = '<' | append: 'img' %}
{% if link.object.content contains img_tag %}
{% assign src = link.object.content | split: 'src="' %}
{% assign src = src[1] | split: '"' | first %}
{% if src %}
{% assign page_has_image = true %}
{% assign image_src = src | replace: '_small', '' | replace: '_compact', '' | replace: '_medium', '' | replace: '_large', '' | replace: '_grande', '' %}
{% assign image_src = src | replace: '_small', '' | replace: '_compact', '' | replace: '_medium', '' |
replace: '_large', '' | replace: '_grande', '' %}
{% endif %}
{% endif %}
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment