Add strike tag support
Add strike tag support to MarkdownParser.
This commit is contained in:
parent
00d22de1a2
commit
0ecdfa1dae
|
@ -80,9 +80,7 @@ std::string make_html(std::filesystem::path const &path) {
|
||||||
tag_p = false,
|
tag_p = false,
|
||||||
tag_li = false,
|
tag_li = false,
|
||||||
tag_ul = false,
|
tag_ul = false,
|
||||||
// If there is an escape character at the end of the buffer, use
|
tag_s = false,
|
||||||
// this flag to prevent ignoring it.
|
|
||||||
escaping = false,
|
|
||||||
newline = true,
|
newline = true,
|
||||||
manualBreak = false,
|
manualBreak = false,
|
||||||
// Used to ignore spaces at the beginning of header titles.
|
// Used to ignore spaces at the beginning of header titles.
|
||||||
|
@ -215,6 +213,20 @@ std::string make_html(std::filesystem::path const &path) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case '~':
|
||||||
|
// Escape character
|
||||||
|
if (x > 0 && buf[x-1] == '\\') {
|
||||||
|
append(c);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (x > 0 && buf[x-1] == '~') {
|
||||||
|
append(tag_s ? "</s>" : "<s>");
|
||||||
|
tag_s = !tag_s;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (buf[x+1] == '~') break;
|
||||||
|
append(c);
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '-':
|
||||||
if (x != 0) {
|
if (x != 0) {
|
||||||
|
|
Loading…
Reference in New Issue