mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 18:17:23 +00:00
LibMarkdown: Rewrite Inline text parser to be more forgiving
The previous Text::parse was not able to give up on parsing a textual element, and just leave it as plain text. Because this is a very important part of markdown, I fully rewrote the parser to support this without having to backtrack. Also the parser now some other little features, such ast delimiter runs and flanking.
This commit is contained in:
parent
80e58dab9a
commit
ec9f892899
Notes:
sideshowbarker
2024-07-18 04:10:58 +09:00
Author: https://github.com/petelliott
Commit: ec9f892899
Pull-request: https://github.com/SerenityOS/serenity/pull/9928
Reviewed-by: https://github.com/BenWiederhake ✅
Reviewed-by: https://github.com/alimpfard
10 changed files with 462 additions and 397 deletions
|
@ -59,10 +59,7 @@ OwnPtr<List> List::parse(Vector<StringView>::ConstIterator& lines)
|
|||
return true;
|
||||
|
||||
auto text = Text::parse(item_builder.string_view());
|
||||
if (!text.has_value())
|
||||
return false;
|
||||
|
||||
items.append(move(text.value()));
|
||||
items.append(move(text));
|
||||
|
||||
item_builder.clear();
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue