File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
# SPDX-License-Identifier: AGPL-3.0-only
2
- import strutils, tables, strformat
2
+ import strutils, tables, strformat, unicode
3
3
import karax/ [karaxdsl, vdom, vstyles]
4
4
from jester import Request
5
5
@@ -31,13 +31,13 @@ proc renderNoteParagraph(articleParagraph: ArticleParagraph; article: Article):
31
31
for er in articleParagraph.entityRanges:
32
32
# flush remaining text
33
33
if er.offset > last:
34
- result .add text text.substr (last, er.offset - 1 )
34
+ result .add text text.runeSubStr (last, er.offset - last )
35
35
36
36
let entity = article.entities[er.key]
37
37
case entity.entityType
38
38
of ArticleEntityType .link:
39
39
let link = buildHtml (a (href= entity.url)):
40
- text text.substr (er.offset, er.offset + er. length - 1 )
40
+ text text.runeSubStr (er.offset, er.length)
41
41
result .add link
42
42
of ArticleEntityType .media:
43
43
for id in entity.mediaIds:
You can’t perform that action at this time.
0 commit comments