mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Raise error on invalid snippet name
This commit is contained in:
committed by
Guilherme Carreiro
parent
98fbd985d8
commit
5ceb0e9cec
@@ -10,7 +10,7 @@ module Liquid
|
||||
# @liquid_description
|
||||
# You can create inline snippets to make your Liquid code more modular.
|
||||
# @liquid_syntax
|
||||
# {% snippet input %}
|
||||
# {% snippet snippet_name %}
|
||||
# value
|
||||
# {% endsnippet %}
|
||||
class Snippet < Block
|
||||
@@ -19,6 +19,7 @@ module Liquid
|
||||
p = @parse_context.new_parser(markup)
|
||||
if p.look(:id)
|
||||
@to = p.consume(:id)
|
||||
p.consume(:end_of_string)
|
||||
else
|
||||
raise SyntaxError, options[:locale].t("errors.syntax.snippet")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user