notes: properly fix inlineStyle length this time

This commit is contained in:
HookedBehemoth 2022-07-23 15:30:07 +02:00
parent 22113d66d7
commit 4b2c8bb41d
1 changed files with 4 additions and 5 deletions

View File

@ -96,7 +96,7 @@ proc renderNoteParagraph(articleParagraph: ArticleParagraph; article: Article; t
let
styleStart = styleRange.offset
styleEnd = styleStart + styleRange.length
if styleStart <= i and styleEnd >= i:
if styleStart <= i and styleEnd > i:
case styleRange.style:
of ArticleStyle.bold:
style.setBit(0)
@ -108,11 +108,10 @@ proc renderNoteParagraph(articleParagraph: ArticleParagraph; article: Article; t
if style != lastStyle:
if i > lastStart:
flushInternal(lastStart, i - lastStart - 1, lastStyle)
lastStart = i - 1
else:
lastStart = i
flushInternal(lastStart, i - lastStart, lastStyle)
lastStyle = style
lastStart = i
if lastStart < len:
flushInternal(lastStart, len - lastStart, lastStyle)