mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
LibMarkdown: Only consider "!" a special character when followed by "["
Fixes #4220.
This commit is contained in:
parent
a34939bcd5
commit
b5b4c50913
|
@ -220,7 +220,7 @@ Optional<Text> Text::parse(const StringView& str)
|
|||
bool is_special_character = false;
|
||||
is_special_character |= ch == '`';
|
||||
if (!current_style.code)
|
||||
is_special_character |= ch == '*' || ch == '_' || ch == '[' || ch == ']' || ch == '!';
|
||||
is_special_character |= ch == '*' || ch == '_' || ch == '[' || ch == ']' || (ch == '!' && offset + 1 < str.length() && str[offset + 1] == '[');
|
||||
if (!is_special_character)
|
||||
continue;
|
||||
|
||||
|
@ -240,8 +240,6 @@ Optional<Text> Text::parse(const StringView& str)
|
|||
}
|
||||
break;
|
||||
case '!':
|
||||
if (offset + 1 >= str.length() || str[offset + 1] != '[')
|
||||
continue;
|
||||
current_link_is_actually_img = true;
|
||||
break;
|
||||
case '[':
|
||||
|
|
Loading…
Reference in a new issue