Skip to content

Commit 40a3fa2

Browse files
committed
fix paginate and list merge
1 parent 6508208 commit 40a3fa2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/coderay/scanners/liquid.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Liquid < Scanner
55

66
register_for :liquid
77

8-
DIRECTIVE_KEYWORDS = /endlist|list|endfor|for|endwrap|wrap|endif|if|endunless|unless|elsif|assignlist|assign|cycle|capture|end|capture|fill|endiflist|iflist|else/
8+
DIRECTIVE_KEYWORDS = /paginate|endlist|list|endfor|for|endwrap|wrap|endif|if|endunless|unless|elsif|assignlist|assign|cycle|capture|end|capture|fill|endiflist|iflist|else/
99

1010
MATH = /==|=|!=|>|<=|<|>|\+/
1111

@@ -97,6 +97,11 @@ def scan_key_value_pair(encoder, options, match)
9797
def scan_selector(encoder, options, match)
9898
scan_spaces(encoder)
9999
if scan_key_value_pair(encoder, options, match)
100+
scan_spaces(encoder)
101+
if match = scan(/\+/)
102+
encoder.text_token match, :directive
103+
end
104+
scan_spaces(encoder)
100105
scan_selector(encoder, options, match)
101106
else
102107
false
@@ -109,7 +114,7 @@ def scan_directive(encoder, options, match)
109114
if match = scan(/#{DIRECTIVE_KEYWORDS}/o)
110115
encoder.text_token match, :directive
111116
scan_spaces(encoder)
112-
if match =~ /if|assign|assignlist|for|list/
117+
if match =~ /if|assign|assignlist|for|list|paginate/
113118
scan_selector(encoder, options, match)
114119
if match = scan(/\w+\.?\w*/)
115120
encoder.text_token match, :variable

0 commit comments

Comments
 (0)