mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
Add a bullet to the beginning of any <li> (#368)
Currently there is no visual indication whatsoever if something is in a list. An `<li>` is essentially just another paragraph. As a partial remedy for this, add a bullet character to the beginning of `<li>` text blocks so that the user can see that they're list items. This is incomplete in that an `<ol>` should also have a counter so that its list items can get numbers instead of bullets (right now I don't think we track if we're in a `<ul>` or an `<ol>` at all), but it's strictly better than the current situation. Co-authored-by: Maeve Andrews <maeve@git.mail.maeveandrews.com>
This commit is contained in:
parent
489220832f
commit
e517945aaa
@ -97,6 +97,9 @@ void XMLCALL ChapterHtmlSlimParser::startElement(void* userData, const XML_Char*
|
|||||||
self->startNewTextBlock(self->currentTextBlock->getStyle());
|
self->startNewTextBlock(self->currentTextBlock->getStyle());
|
||||||
} else {
|
} else {
|
||||||
self->startNewTextBlock((TextBlock::Style)self->paragraphAlignment);
|
self->startNewTextBlock((TextBlock::Style)self->paragraphAlignment);
|
||||||
|
if (strcmp(name, "li") == 0) {
|
||||||
|
self->currentTextBlock->addWord("\xe2\x80\xa2", EpdFontFamily::REGULAR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (matches(name, BOLD_TAGS, NUM_BOLD_TAGS)) {
|
} else if (matches(name, BOLD_TAGS, NUM_BOLD_TAGS)) {
|
||||||
self->boldUntilDepth = std::min(self->boldUntilDepth, self->depth);
|
self->boldUntilDepth = std::min(self->boldUntilDepth, self->depth);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user