mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 21:26:22 +00:00
LibMarkdown: Add LineIterator
LineIterator wraps a vector's ConstIterator, to provide an iterator that can work on indented container blocks (like lists and blockquotes).
This commit is contained in:
parent
cd560d3ae3
commit
10f6f6a723
Notes:
sideshowbarker
2024-07-18 03:02:28 +09:00
Author: https://github.com/petelliott
Commit: 10f6f6a723
Pull-request: https://github.com/SerenityOS/serenity/pull/10271
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/kleinesfilmroellchen
16 changed files with 139 additions and 21 deletions
|
@ -96,7 +96,7 @@ String Table::render_to_html() const
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
OwnPtr<Table> Table::parse(Vector<StringView>::ConstIterator& lines)
|
||||
OwnPtr<Table> Table::parse(LineIterator& lines)
|
||||
{
|
||||
auto peek_it = lines;
|
||||
auto first_line = *peek_it;
|
||||
|
@ -178,7 +178,7 @@ OwnPtr<Table> Table::parse(Vector<StringView>::ConstIterator& lines)
|
|||
size_t row_count = 0;
|
||||
++lines;
|
||||
while (!lines.is_end()) {
|
||||
auto& line = *lines;
|
||||
auto line = *lines;
|
||||
if (!line.starts_with('|'))
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue