1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:37:35 +00:00

LibMarkdown: Handle CRLF line endings

Previously, MDDocument only split on Unix-style line endings. This adds
a new function to StringView which handles LF, CR and CRLF.
This commit is contained in:
Tommy Nguyen 2019-12-02 07:42:33 -05:00 committed by Andreas Kling
parent 035c4e15f4
commit 2eb5793d55
4 changed files with 68 additions and 1 deletions

View file

@ -49,7 +49,7 @@ static bool helper(Vector<StringView>::ConstIterator& lines, NonnullOwnPtrVector
bool MDDocument::parse(const StringView& str)
{
const Vector<StringView> lines_vec = str.split_view('\n', true);
const Vector<StringView> lines_vec = str.lines();
auto lines = lines_vec.begin();
while (true) {