HaikuDepot: Detect more ways to start bullet list items
* Besides the previous " * ", detect " - ", "* " and "- ".
This commit is contained in:
@@ -195,11 +195,11 @@ MarkupParser::_ParseText(const BString& text)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ' ':
|
case ' ':
|
||||||
// Detect bullets at line starts
|
// Detect bullets at line starts (preceeding space)
|
||||||
if (offset == start
|
if (offset == start
|
||||||
&& fCurrentParagraph.IsEmpty()
|
&& fCurrentParagraph.IsEmpty()
|
||||||
&& offset + 2 < charCount
|
&& offset + 2 < charCount
|
||||||
&& c[0] == '*' && c[1] == ' ') {
|
&& (c[0] == '*' || c[0] == '-') && c[1] == ' ') {
|
||||||
|
|
||||||
fCurrentParagraph.SetStyle(fBulletStyle);
|
fCurrentParagraph.SetStyle(fBulletStyle);
|
||||||
|
|
||||||
@@ -210,6 +210,23 @@ MarkupParser::_ParseText(const BString& text)
|
|||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user