Skip to content

Commit

Permalink
fix bluesky rich text parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Oct 31, 2024
1 parent 89efc99 commit 1072573
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ private fun parseBluesky(
val end = facet.index.byteEnd.toInt()
// some facets may have same start
// for example: https://bsky.app/profile/technews4869.bsky.social/post/3l4vfqetv7t25
if (codePointIndex > start) {
if (start - codePointIndex < 0) {
continue
}
val beforeFacetText = codePoints.drop(codePointIndex).take(start - codePointIndex).stringify()
element.appendTextWithBr(beforeFacetText)
if (end - start < 0) {
continue
}
val facetText = codePoints.drop(start).take(end - start).stringify()
// TODO: multiple features
val feature = facet.features.firstOrNull()
Expand Down

0 comments on commit 1072573

Please sign in to comment.