1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:37:44 +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:
Peter Elliott 2021-09-19 11:14:18 -06:00 committed by Ali Mohammad Pur
parent cd560d3ae3
commit 10f6f6a723
16 changed files with 139 additions and 21 deletions

View file

@ -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;