mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibMarkdown: Allow spaces before list items
also allow '+' as an unordered list marker
This commit is contained in:
parent
0a21c2bace
commit
a76a23e33b
Notes:
sideshowbarker
2024-07-18 08:59:31 +09:00
Author: https://github.com/petelliott Commit: https://github.com/SerenityOS/serenity/commit/a76a23e33b1 Pull-request: https://github.com/SerenityOS/serenity/pull/10271 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/kleinesfilmroellchen
@ -67,15 +67,19 @@ OwnPtr<List> List::parse(LineIterator& lines)
|
||||
const StringView& line = *lines;
|
||||
|
||||
bool appears_unordered = false;
|
||||
if (line.length() > 2) {
|
||||
if (line[1] == ' ' && (line[0] == '*' || line[0] == '-')) {
|
||||
|
||||
while (offset < line.length() && line[offset] == ' ')
|
||||
++offset;
|
||||
|
||||
if (offset + 2 <= line.length()) {
|
||||
if (line[offset + 1] == ' ' && (line[offset] == '*' || line[offset] == '-' || line[offset] == '+')) {
|
||||
appears_unordered = true;
|
||||
offset = 1;
|
||||
offset++;
|
||||
}
|
||||
}
|
||||
|
||||
bool appears_ordered = false;
|
||||
for (size_t i = 0; i < 10 && i < line.length(); i++) {
|
||||
for (size_t i = offset; i < 10 && i < line.length(); i++) {
|
||||
char ch = line[i];
|
||||
if ('0' <= ch && ch <= '9')
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user