mirror of
https://github.com/discourse/discourse.git
synced 2025-06-23 02:31:33 +08:00
FIX: Only wrap inline html tags in <p>
This commit is contained in:
@ -56,6 +56,14 @@ test("Line Breaks", function() {
|
||||
"it handles new lines correctly with [] options");
|
||||
});
|
||||
|
||||
test("Paragraphs for HTML", function() {
|
||||
cooked("<div>hello world</div>", "<div>hello world</div>", "it doesn't surround <div> with paragraphs");
|
||||
cooked("<p>hello world</p>", "<p>hello world</p>", "it doesn't surround <p> with paragraphs");
|
||||
cooked("<i>hello world</i>", "<p><i>hello world</i></p>", "it surrounds inline <i> html tags with paragraphs");
|
||||
cooked("<b>hello world</b>", "<p><b>hello world</b></p>", "it surrounds inline <b> html tags with paragraphs");
|
||||
|
||||
});
|
||||
|
||||
test("Links", function() {
|
||||
|
||||
cooked("EvilTrout: http://eviltrout.com",
|
||||
@ -300,7 +308,7 @@ test("sanitize", function() {
|
||||
cooked("hello<script>alert(42)</script>", "<p>hello</p>", "it sanitizes while cooking");
|
||||
|
||||
cooked("<a href='http://disneyland.disney.go.com/'>disney</a> <a href='http://reddit.com'>reddit</a>",
|
||||
"<a href=\"http://disneyland.disney.go.com/\">disney</a> <a href=\"http://reddit.com\">reddit</a>",
|
||||
"<p><a href=\"http://disneyland.disney.go.com/\">disney</a> <a href=\"http://reddit.com\">reddit</a></p>",
|
||||
"we can embed proper links");
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user