Skip to content

Commit

Permalink
Handle some HTML tags in MD parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Nov 29, 2023
1 parent fff942a commit 34a50df
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions src/import/markdown_extract_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"&ge;", 4) == 0)
{
add_characters(L">=");
previousChar = L'=';
start += 4;
continue;
}
else if (std::wcsncmp(start, L"&le;", 4) == 0)
{
add_characters(L"<=");
previousChar = L'=';
start += 4;
continue;
}
}
}
// code blocks
else if (*start == L'`')
{
Expand Down

0 comments on commit 34a50df

Please sign in to comment.