mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
Better API for parsing out blocks in the parser.
This commit is contained in:
parent
bbd79aafd1
commit
3cec95a2c3
6 changed files with 107 additions and 181 deletions
|
@ -11,8 +11,8 @@ test('basic bbcode', function() {
|
|||
format("[i]emphasis[/i]", "<span class=\"bbcode-i\">emphasis</span>", "italics text");
|
||||
format("[u]underlined[/u]", "<span class=\"bbcode-u\">underlined</span>", "underlines text");
|
||||
format("[s]strikethrough[/s]", "<span class=\"bbcode-s\">strikethrough</span>", "strikes-through text");
|
||||
format("[code]\nx++\n[/code]", "<pre>\nx++<br/>\n</pre>", "makes code into pre");
|
||||
format("[code]\nx++\ny++\nz++\n[/code]", "<pre>\nx++<br/>\ny++<br/>\nz++<br/>\n</pre>", "makes code into pre");
|
||||
format("[code]\nx++\n[/code]", "<pre>\nx++</pre>", "makes code into pre");
|
||||
format("[code]\nx++\ny++\nz++\n[/code]", "<pre>\nx++\ny++\nz++</pre>", "makes code into pre");
|
||||
format("[spoiler]it's a sled[/spoiler]", "<span class=\"spoiler\">it's a sled</span>", "supports spoiler tags");
|
||||
format("[img]http://eviltrout.com/eviltrout.png[/img]", "<img src=\"http://eviltrout.com/eviltrout.png\"/>", "links images");
|
||||
format("[url]http://bettercallsaul.com[/url]", "<a href=\"http://bettercallsaul.com\">http://bettercallsaul.com</a>", "supports [url] without a title");
|
||||
|
|
|
@ -114,7 +114,7 @@ test("Quotes", function() {
|
|||
cookedOptions("[quote=\"eviltrout, post: 1\"]\na quote\n\nsecond line\n[/quote]",
|
||||
{ topicId: 2 },
|
||||
"<p><aside class=\"quote\" data-post=\"1\"><div class=\"title\"><div class=\"quote-controls\"></div>eviltrout said:</div><blockquote>" +
|
||||
"a quote<br/><br/>second line<br/></blockquote></aside></p>",
|
||||
"a quote<br/><br/>second line</blockquote></aside></p>",
|
||||
"works with multiple lines");
|
||||
|
||||
cookedOptions("1[quote=\"bob, post:1\"]my quote[/quote]2",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue