瀏覽代碼

LibMarkdown: Ignore backslash on non-punctuation characters

Peter Elliott 3 年之前
父節點
當前提交
5ad44ac2e5
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibMarkdown/Text.cpp

+ 1 - 1
Userland/Libraries/LibMarkdown/Text.cpp

@@ -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 == '`') {