diff --git a/src/MarkdownParser.cxx b/src/MarkdownParser.cxx index 1d3f538..ea0e57a 100644 --- a/src/MarkdownParser.cxx +++ b/src/MarkdownParser.cxx @@ -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 ? "" : ""); + tag_s = !tag_s; + break; + } + if (buf[x+1] == '~') break; + append(c); break; case '-': if (x != 0) {