feat(parser): improve inline object parsing

This commit is contained in:
PoiScript 2019-05-18 21:34:29 +08:00
parent c4041aefb6
commit 3beabcedfa
3 changed files with 98 additions and 76 deletions

View file

@ -18,6 +18,12 @@ macro_rules! html_test {
html_test!(
emphasis,
"*bold*, /italic/,_underlined_, =verbatim= and ~code~",
"<section><p><b>bold</b>, <i>italic</i>,<u>underlined</u>, <code>verbatim</code> and <code>code</code></p></section>"
);
html_test!(
section_and_headline,
r#"* Title 1
*Section 1*
** Title 2
@ -26,10 +32,14 @@ _Section 2_
/Section 3/
* Title 4
=Section 4="#,
"<h1>Title 1</h1><section><p><b>Section 1</b></p></section>\
<h2>Title 2</h2><section><p><u>Section 2</u></p></section>\
<h1>Title 3</h1><section><p><i>Section 3</i></p></section>\
<h1>Title 4</h1><section><p><code>Section 4</code></p></section>"
"<h1>Title 1</h1>\
<section><p><b>Section 1</b></p></section>\
<h2>Title 2</h2>\
<section><p><u>Section 2</u></p></section>\
<h1>Title 3</h1>\
<section><p><i>Section 3</i></p></section>\
<h1>Title 4</h1>\
<section><p><code>Section 4</code></p></section>"
);
html_test!(
@ -49,3 +59,9 @@ html_test!(
<li><p>5</p></li>\
</ul></section>"
);
html_test!(
snippet,
"@@html:<del>@@delete this@@html:</del>@@",
"<section><p><del>delete this</del></p></section>"
);