mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:27:45 +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
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