FIX: Only wrap inline html tags in <p>
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- Our HTML sanitizer escapes > as > even though Markdown doesn't specify that.
|
||||
-->
|
||||
<p>AT&T has an ampersand in their name.</p>
|
||||
|
||||
<p>AT&T is another way to write it.</p>
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- Our HTML sanitizer escapes quotes " as "
|
||||
- Our sanitizer has not whitelisted attr attributes in `span`s
|
||||
- Our sanitizer replaces backticks with ` in code blocks
|
||||
-->
|
||||
<p>These should all get escaped:</p>
|
||||
|
||||
<p>Backslash: \</p>
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- Our HTML sanitizer escapes quotes " as "
|
||||
-->
|
||||
<blockquote>
|
||||
<p>Example:</p>
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- Our HTML sanitizer escapes quotes " as "
|
||||
- Our sanitizer has not whitelisted attr attributes in `span`s
|
||||
- Our sanitizer replaces backticks with `
|
||||
-->
|
||||
<p><code><test a="</code> content of attribute <code>"></code></p>
|
||||
|
||||
<p>Fix for backticks within HTML tag: <span>like this</span></p>
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- Our HTML sanitizer removes the style tag
|
||||
- It removes id and classes.
|
||||
-->
|
||||
<p>Simple block on one line:</p>
|
||||
|
||||
<div>foo</div>
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- It removes id and classes.
|
||||
-->
|
||||
<p>Here's a simple block:</p>
|
||||
|
||||
<div>
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- Our HTML sanitizer puts ' in attributes
|
||||
-->
|
||||
<p>Just a <a href="/url/">URL</a>.</p>
|
||||
|
||||
<p><a href="/url/" title="title">URL and title</a>.</p>
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- Sanitized elements and entities
|
||||
-->
|
||||
<h1>Markdown: Basics</h1>
|
||||
|
||||
<ul>
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
<!--
|
||||
Changed for Discourse:
|
||||
|
||||
- Sanitized elements and entities
|
||||
-->
|
||||
<h1>Markdown: Syntax</h1>
|
||||
|
||||
<ul>
|
||||
|
||||
@@ -19,7 +19,6 @@ var md = function(input, expected, text) {
|
||||
expectedNorm = normalize(expected),
|
||||
same = (result === expected) || (resultNorm === expectedNorm);
|
||||
|
||||
|
||||
if (same) {
|
||||
ok(same, text);
|
||||
} else {
|
||||
@@ -42,7 +41,7 @@ test("first", function(){
|
||||
filename = Pathname.new(filename_no_ext)
|
||||
|
||||
text = File.read(f)
|
||||
html = File.read("#{filename_no_ext}.xhtml").gsub(/\<\!\-\-(.*?)\-\-\>/m, '')
|
||||
html = File.read("#{filename_no_ext}.xhtml");
|
||||
result << "test(\"#{filename}\", function() { md(#{text.to_json}, #{html.to_json}, 'passes MDTest'); });\n"
|
||||
end
|
||||
result
|
||||
|
||||
Reference in New Issue
Block a user