From 34a50df2fff1b244a2e8ca2a3d946911c5fed210 Mon Sep 17 00:00:00 2001 From: Blake-Madden Date: Wed, 29 Nov 2023 12:24:39 -0500 Subject: [PATCH] Handle some HTML tags in MD parser --- src/import/markdown_extract_text.cpp | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/import/markdown_extract_text.cpp b/src/import/markdown_extract_text.cpp index faa6fa05..14ece018 100644 --- a/src/import/markdown_extract_text.cpp +++ b/src/import/markdown_extract_text.cpp @@ -135,6 +135,62 @@ const wchar_t* lily_of_the_valley::markdown_extract_text::operator()(const std:: continue; } } + // block quotes + else if (*start == L'&') + { + if (!isEscaping) + { + if (std::wcsncmp(start, L"&", 5) == 0) + { + add_character(L'&'); + previousChar = L'&'; + start += 5; + continue; + } + else if (std::wcsncmp(start, L""", 6) == 0) + { + add_character(L'\"'); + previousChar = L'\"'; + start += 6; + continue; + } + else if (std::wcsncmp(start, L"'", 6) == 0) + { + add_character(L'\''); + previousChar = L'\''; + start += 6; + continue; + } + else if (std::wcsncmp(start, L">", 4) == 0) + { + add_character(L'>'); + previousChar = L'>'; + start += 4; + continue; + } + else if (std::wcsncmp(start, L"<", 4) == 0) + { + add_character(L'<'); + previousChar = L'<'; + start += 4; + continue; + } + else if (std::wcsncmp(start, L"≥", 4) == 0) + { + add_characters(L">="); + previousChar = L'='; + start += 4; + continue; + } + else if (std::wcsncmp(start, L"≤", 4) == 0) + { + add_characters(L"<="); + previousChar = L'='; + start += 4; + continue; + } + } + } // code blocks else if (*start == L'`') {