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_li = false,
|
||||
tag_ul = false,
|
||||
// If there is an escape character at the end of the buffer, use
|
||||
// this flag to prevent ignoring it.
|
||||
escaping = false,
|
||||
tag_s = false,
|
||||
newline = true,
|
||||
manualBreak = false,
|
||||
// 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;
|
||||
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;
|
||||
case '-':
|
||||
if (x != 0) {
|
||||
|
|
Loading…
Reference in New Issue