File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,10 @@ def extracted_html
3131 end
3232
3333 # We want to strip out the liquid tags and replace them with the
34- # same number of empty space characters, so that the linter
35- # reports the correct character number.
34+ # same number of characters, so that the linter reports the
35+ # correct character number.
3636 def strip_out_liquid ( html )
37- html . gsub ( LIQUID_TAG_OR_VARIABLE ) { |tag | " " * tag . size }
37+ html . gsub ( LIQUID_TAG_OR_VARIABLE ) { |tag | "x " * tag . size }
3838 end
3939
4040 # We want to strip out the front matter and replace it
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module Canvas
4- VERSION = "4.15 .0"
4+ VERSION = "4.16 .0"
55end
Original file line number Diff line number Diff line change 1717 message = <<~MESSAGE . chop
1818 Invalid HTML: blocks/hero/block.liquid - \n
1919 14:16: ERROR: Start tag of nonvoid HTML element ends with '/>', use '>'.
20- <h1> <foo/>
20+ <h1>xxxxxxxxxxx <foo/>
2121 ^
2222 MESSAGE
2323
Original file line number Diff line number Diff line change 4444
4545 expect ( Canvas ::Validator ::Html . new ( html ) . validate ) . to be_truthy
4646 end
47+
48+ it "strips out liquid" do
49+ html = <<-LIQUID
50+ <{{ tag | default: 'div' }}>This is valid html</{{ tag | default: 'div' }}>
51+ LIQUID
52+
53+ expect ( Canvas ::Validator ::Html . new ( html ) . validate ) . to be_truthy
54+ end
4755 end
4856end
You can’t perform that action at this time.
0 commit comments