mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-01-04 13:11:12 +00:00
Clickable usernames and hashtags
Should work well enough. Report edge cases.
This commit is contained in:
@@ -2,6 +2,7 @@ const constants = require("../constants")
|
||||
const {proxyImage, proxyExtendedOwner} = require("../utils/proxyurl")
|
||||
const {compile} = require("pug")
|
||||
const collectors = require("../collectors")
|
||||
const {structure} = require("../utils/structuretext")
|
||||
const TimelineBaseMethods = require("./TimelineBaseMethods")
|
||||
const TimelineChild = require("./TimelineChild")
|
||||
require("../testimports")(collectors, TimelineChild, TimelineBaseMethods)
|
||||
@@ -87,6 +88,12 @@ class TimelineEntry extends TimelineBaseMethods {
|
||||
else return edge.node.text.replace(/\u2063/g, "") // I don't know why U+2063 INVISIBLE SEPARATOR is in here, but it is, and it causes rendering issues with certain fonts, so let's just remove it.
|
||||
}
|
||||
|
||||
getStructuredCaption() {
|
||||
const caption = this.getCaption()
|
||||
if (!caption) return null // no caption
|
||||
else return structure(caption)
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to get the first meaningful line or sentence from the caption.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user