checkpoint

This commit is contained in:
Josh Faigan
2024-09-30 11:25:48 -04:00
parent 98a69c80ef
commit 404d71613c
3 changed files with 96 additions and 18 deletions
+5 -5
View File
@@ -14,17 +14,17 @@ module Liquid
# value
# {% endsnippet %}
class Snippet < Block
# SYNTAX = /(#{QuotedString}+) +\|(#{VariableSegment}*)\|/o
SYNTAX = /(#{QuotedString}+)/o
SYNTAX = /(#{QuotedString}+) +\|(#{VariableSegment}*)\|/o
def initialize(tag_name, markup, options)
super
if markup =~ SYNTAX
# binding.irb
@to = Regexp.last_match(1)
# arg = Regexp.last_match(2)
arg = Regexp.last_match(2)
# @args = []
# @args << arg if arg
@args = []
@args << arg if arg
else
raise SyntaxError, options[:locale].t("errors.syntax.snippet")
end