mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Fix handling of unknown tags in comments
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
|
require "liquid/tags/raw"
|
||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
class Comment < Block
|
class Comment < Raw
|
||||||
def render(context)
|
def render(context)
|
||||||
''
|
''
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ class StandardTagTest < Test::Unit::TestCase
|
|||||||
assert_template_result('','{%comment%}comment{%endcomment%}')
|
assert_template_result('','{%comment%}comment{%endcomment%}')
|
||||||
assert_template_result('','{% comment %}comment{% endcomment %}')
|
assert_template_result('','{% comment %}comment{% endcomment %}')
|
||||||
|
|
||||||
|
assert_template_result('','{%comment%}{%blabla%}{%endcomment%}')
|
||||||
|
assert_template_result('','{% comment %}{% blabla %}{% endcomment %}')
|
||||||
|
assert_template_result('','{%comment%}{% endif %}{%endcomment%}')
|
||||||
|
assert_template_result('','{% comment %}{% endwhatever %}{% endcomment %}')
|
||||||
|
assert_template_result('','{% comment %} {{ %} {{%%%}} {% endcomment {% endcomment %}')
|
||||||
|
|
||||||
assert_template_result('foobar','foo{%comment%}comment{%endcomment%}bar')
|
assert_template_result('foobar','foo{%comment%}comment{%endcomment%}bar')
|
||||||
assert_template_result('foobar','foo{% comment %}comment{% endcomment %}bar')
|
assert_template_result('foobar','foo{% comment %}comment{% endcomment %}bar')
|
||||||
assert_template_result('foobar','foo{%comment%} comment {%endcomment%}bar')
|
assert_template_result('foobar','foo{%comment%} comment {%endcomment%}bar')
|
||||||
|
|||||||
Reference in New Issue
Block a user