From b7cb4587b0a2664d9ad9bd8cb262bf78ad2f1bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 24 Nov 2013 21:09:31 +0100 Subject: [PATCH] HaikuDepot: Try slightly harder to keep paragraphs together * Some commented-out code to require two line-breaks to start a new paragraph. Doesn't work well with current set of packages. * If the character before a line-break is a space, do not start a new paragraph. Doesn't seem to occur in current package descriptions. --- .../haiku-depot/textview/MarkupParser.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/apps/haiku-depot/textview/MarkupParser.cpp b/src/apps/haiku-depot/textview/MarkupParser.cpp index 5d3b8ad2d5..285ac6f909 100644 --- a/src/apps/haiku-depot/textview/MarkupParser.cpp +++ b/src/apps/haiku-depot/textview/MarkupParser.cpp @@ -137,7 +137,28 @@ MarkupParser::_ParseText(const BString& text) uint32 nextChar = UTF8ToCharCode(&c); switch (nextChar) { +// Requires two line-breaks to start a new paragraph, unles the current +// paragraph is already considered a bullet list item. Doesn't work well +// with current set of packages. +// case '\n': +// _CopySpan(text, start, offset); +// if (offset + 1 < charCount && c[0] == '\n') { +// _FinishParagraph(); +// offset += 1; +// c += 1; +// } else if (fCurrentParagraph.Style() == fBulletStyle) { +// _FinishParagraph(); +// } +// start = offset + 1; +// break; + case '\n': + _CopySpan(text, start, offset); + if (offset > 0 && c[-1] != ' ') + _FinishParagraph(); + start = offset + 1; + break; + case '\0': _CopySpan(text, start, offset); _FinishParagraph();