[ruby/rdoc] Allow RDoc markups in table cells
https://github.com/ruby/rdoc/commit/b16d3f1727
This commit is contained in:
parent
e929b0aac5
commit
75a53f6be0
@ -324,7 +324,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||||||
header.zip(aligns) do |text, align|
|
header.zip(aligns) do |text, align|
|
||||||
@res << '<th'
|
@res << '<th'
|
||||||
@res << ' align="' << align << '"' if align
|
@res << ' align="' << align << '"' if align
|
||||||
@res << '>' << CGI.escapeHTML(text) << "</th>\n"
|
@res << '>' << to_html(text) << "</th>\n"
|
||||||
end
|
end
|
||||||
@res << "</tr>\n</thead>\n<tbody>\n"
|
@res << "</tr>\n</thead>\n<tbody>\n"
|
||||||
body.each do |row|
|
body.each do |row|
|
||||||
@ -332,7 +332,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||||||
row.zip(aligns) do |text, align|
|
row.zip(aligns) do |text, align|
|
||||||
@res << '<td'
|
@res << '<td'
|
||||||
@res << ' align="' << align << '"' if align
|
@res << ' align="' << align << '"' if align
|
||||||
@res << '>' << CGI.escapeHTML(text) << "</td>\n"
|
@res << '>' << to_html(text) << "</td>\n"
|
||||||
end
|
end
|
||||||
@res << "</tr>\n"
|
@res << "</tr>\n"
|
||||||
end
|
end
|
||||||
|
@ -882,6 +882,7 @@ EXPECTED
|
|||||||
%w[cell1_1 cell1_2 cell1_3],
|
%w[cell1_1 cell1_2 cell1_3],
|
||||||
%w[cell2_1 cell2_2 cell2_3],
|
%w[cell2_1 cell2_2 cell2_3],
|
||||||
['<script>alert("foo");</script>',],
|
['<script>alert("foo");</script>',],
|
||||||
|
%w[+code+ _em_ **strong**],
|
||||||
]
|
]
|
||||||
aligns = [:left, :right, nil]
|
aligns = [:left, :right, nil]
|
||||||
@to.start_accepting
|
@to.start_accepting
|
||||||
@ -898,6 +899,9 @@ EXPECTED
|
|||||||
assert_not_include(res[%r<<td[^<>]*>cell2_3</td>>], 'align=')
|
assert_not_include(res[%r<<td[^<>]*>cell2_3</td>>], 'align=')
|
||||||
assert_not_include(res, '<script>')
|
assert_not_include(res, '<script>')
|
||||||
assert_include(res[%r<<td[^<>]*>.*script.*</td>>], '<script>')
|
assert_include(res[%r<<td[^<>]*>.*script.*</td>>], '<script>')
|
||||||
|
assert_include(res[%r<<td[^<>]*>.*code.*</td>>], '<code>code</code>')
|
||||||
|
assert_include(res[%r<<td[^<>]*>.*em.*</td>>], '<em>em</em>')
|
||||||
|
assert_include(res[%r<<td[^<>]*>.*strong.*</td>>], '<strong>strong</strong>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user