mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Allow question-mark at end of variable name only
This commit is contained in:
+2
-2
@@ -29,7 +29,7 @@ module Liquid
|
|||||||
TagStart = /\{\%/
|
TagStart = /\{\%/
|
||||||
TagEnd = /\%\}/
|
TagEnd = /\%\}/
|
||||||
VariableSignature = /\(?[\w\-\.\[\]]\)?/
|
VariableSignature = /\(?[\w\-\.\[\]]\)?/
|
||||||
VariableSegment = /[\w\-]\??/
|
VariableSegment = /[\w\-]/
|
||||||
VariableStart = /\{\{/
|
VariableStart = /\{\{/
|
||||||
VariableEnd = /\}\}/
|
VariableEnd = /\}\}/
|
||||||
VariableIncompleteEnd = /\}\}?/
|
VariableIncompleteEnd = /\}\}?/
|
||||||
@@ -44,7 +44,7 @@ module Liquid
|
|||||||
AnyStartingTag = /\{\{|\{\%/
|
AnyStartingTag = /\{\{|\{\%/
|
||||||
PartialTemplateParser = /#{TagStart}.*?#{TagEnd}|#{VariableStart}.*?#{VariableIncompleteEnd}/
|
PartialTemplateParser = /#{TagStart}.*?#{TagEnd}|#{VariableStart}.*?#{VariableIncompleteEnd}/
|
||||||
TemplateParser = /(#{PartialTemplateParser}|#{AnyStartingTag})/
|
TemplateParser = /(#{PartialTemplateParser}|#{AnyStartingTag})/
|
||||||
VariableParser = /\[[^\]]+\]|#{VariableSegment}+/
|
VariableParser = /\[[^\]]+\]|#{VariableSegment}+\??/
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'liquid/drop'
|
require 'liquid/drop'
|
||||||
|
|||||||
Reference in New Issue
Block a user