Skip to content

Commit 4b2c8bb

Browse files
notes: properly fix inlineStyle length this time
1 parent 22113d6 commit 4b2c8bb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/views/notes.nim

+4-5
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ proc renderNoteParagraph(articleParagraph: ArticleParagraph; article: Article; t
9696
let
9797
styleStart = styleRange.offset
9898
styleEnd = styleStart + styleRange.length
99-
if styleStart <= i and styleEnd >= i:
99+
if styleStart <= i and styleEnd > i:
100100
case styleRange.style:
101101
of ArticleStyle.bold:
102102
style.setBit(0)
@@ -108,11 +108,10 @@ proc renderNoteParagraph(articleParagraph: ArticleParagraph; article: Article; t
108108

109109
if style != lastStyle:
110110
if i > lastStart:
111-
flushInternal(lastStart, i - lastStart - 1, lastStyle)
112-
lastStart = i - 1
113-
else:
114-
lastStart = i
111+
flushInternal(lastStart, i - lastStart, lastStyle)
112+
115113
lastStyle = style
114+
lastStart = i
116115

117116
if lastStart < len:
118117
flushInternal(lastStart, len - lastStart, lastStyle)

0 commit comments

Comments
 (0)