File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class HTMLwithSyntaxHighlight < HTML
14
14
def initialize ( extensions = { } )
15
15
super ( extensions . merge ( :xhtml => true ,
16
16
:no_styles => true ,
17
- :filter_html => true ,
17
+ :escape_html => true ,
18
18
:hard_wrap => true ) )
19
19
end
20
20
Original file line number Diff line number Diff line change @@ -259,5 +259,22 @@ class Foo; end
259
259
specify { doc . css ( 'pre' ) . should be_empty }
260
260
end
261
261
end
262
+
263
+ describe 'Escape HTML tags' do
264
+ context '<xxx> or a book names' do
265
+ let ( :raw ) { "<Enterprise Integration Patterns> book" }
266
+ its ( :inner_html ) { should == "<p><Enterprise Integration Patterns> book</p>" }
267
+ end
268
+
269
+ context '<img> tag' do
270
+ let ( :raw ) { "<img src='aaa.jpg' /> aaa" }
271
+ its ( :inner_html ) { should == "<p><img src='aaa.jpg' /> aaa</p>" }
272
+ end
273
+
274
+ context '<b> tag' do
275
+ let ( :raw ) { "<b>aaa</b>" }
276
+ its ( :inner_html ) { should == "<p><b>aaa</b></p>" }
277
+ end
278
+ end
262
279
end
263
280
end
You can’t perform that action at this time.
0 commit comments