mirror of
https://github.com/Shopify/liquid.git
synced 2025-08-31 00:03:18 -04:00
make markup validation a method on Liquid::Raw
This commit is contained in:
parent
361c695264
commit
a80ecb7678
@ -6,9 +6,7 @@ module Liquid
|
||||
def initialize(tag_name, markup, parse_context)
|
||||
super
|
||||
|
||||
unless markup =~ Syntax
|
||||
raise SyntaxError.new(parse_context.locale.t("errors.syntax.tag_unexpected_args".freeze, tag: tag_name))
|
||||
end
|
||||
ensure_valid_markup(tag_name, markup, parse_context)
|
||||
end
|
||||
|
||||
def parse(tokens)
|
||||
@ -35,6 +33,14 @@ module Liquid
|
||||
def blank?
|
||||
@body.empty?
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def ensure_valid_markup(tag_name, markup, parse_context)
|
||||
unless markup =~ Syntax
|
||||
raise SyntaxError.new(parse_context.locale.t("errors.syntax.tag_unexpected_args".freeze, tag: tag_name))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Template.register_tag('raw'.freeze, Raw)
|
||||
|
Loading…
x
Reference in New Issue
Block a user