Add strike tag support

Add strike tag support to MarkdownParser.
This commit is contained in:
luca0N! 2022-03-22 18:05:36 -03:00
parent 00d22de1a2
commit 0ecdfa1dae
Signed by: luca0N
GPG Key ID: 2E7B4655CF16D7D6
1 changed files with 15 additions and 3 deletions

View File

@ -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) {