HaikuDepot: Detect more ways to start bullet list items

* Besides the previous " * ", detect " - ", "* " and "- ".
This commit is contained in:
Stephan Aßmus
2013-11-24 21:12:29 +01:00
parent f3c471f44c
commit 9fb4da1c9d
+19 -2
View File
@@ -195,11 +195,11 @@ MarkupParser::_ParseText(const BString& text)
break;
case ' ':
// Detect bullets at line starts
// Detect bullets at line starts (preceeding space)
if (offset == start
&& fCurrentParagraph.IsEmpty()
&& offset + 2 < charCount
&& c[0] == '*' && c[1] == ' ') {
&& (c[0] == '*' || c[0] == '-') && c[1] == ' ') {
fCurrentParagraph.SetStyle(fBulletStyle);
@@ -210,6 +210,23 @@ MarkupParser::_ParseText(const BString& text)
}
break;
case '*':
case '-':
// Detect bullets at line starts (no preceeding space)
if (offset == start
&& fCurrentParagraph.IsEmpty()
&& offset + 1 < charCount
&& c[0] == ' ') {
fCurrentParagraph.SetStyle(fBulletStyle);
offset += 1;
c += 1;
start = offset + 1;
}
break;
default:
break;