1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00

LibMarkdown: Ignore backslash on non-punctuation characters

This commit is contained in:
Peter Elliott 2022-04-21 23:41:18 -06:00 committed by Andreas Kling
parent 0270e23997
commit 5ad44ac2e5

View file

@ -327,7 +327,7 @@ Vector<Text::Token> Text::tokenize(StringView str)
in_space = false;
}
if (ch == '\\' && offset + 1 < str.length()) {
if (ch == '\\' && offset + 1 < str.length() && ispunct(str[offset + 1])) {
current_token.append(str[offset + 1]);
++offset;
} else if (ch == '*' || ch == '_' || ch == '`') {