mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
LibMarkdown: Make warning messages conditional
This is especially a problem during fuzzing.
This commit is contained in:
parent
e3101c74c6
commit
da966ac8d8
2 changed files with 7 additions and 1 deletions
|
@ -29,6 +29,8 @@
|
|||
#include <LibMarkdown/Text.h>
|
||||
#include <string.h>
|
||||
|
||||
//#define DEBUG_MARKDOWN
|
||||
|
||||
namespace Markdown {
|
||||
|
||||
static String unescape(const StringView& text)
|
||||
|
@ -238,13 +240,17 @@ Optional<Text> Text::parse(const StringView& str)
|
|||
current_link_is_actually_img = true;
|
||||
break;
|
||||
case '[':
|
||||
#ifdef DEBUG_MARKDOWN
|
||||
if (first_span_in_the_current_link != -1)
|
||||
dbg() << "Dropping the outer link";
|
||||
#endif
|
||||
first_span_in_the_current_link = spans.size();
|
||||
break;
|
||||
case ']': {
|
||||
if (first_span_in_the_current_link == -1) {
|
||||
#ifdef DEBUG_MARKDOWN
|
||||
dbg() << "Unmatched ]";
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
ScopeGuard guard = [&] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue