mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-22 11:15:41 +02:00
feat: suppress rendered media attachment URLs from tweet text
renderTweetTextJSX now accepts skipSpans=[] as third param. Skip-span boundaries are added to the pts split set so a trailing media t.co inside a plain segment still gets isolated and suppressed— not re-linked by linkifyText. Early return only when both anns and skipSpans are empty. TweetCard computes mediaSkipSpans after building photos/videoItems: for each rawMedia item whose src resolved (photo src match; any video), resolveEntityBounds(m, ft, m.url) gives the precise [s,e] span using indices/fromIndex first, indexOf fallback—then the span is passed to renderTweetTextJSX so the t.co attachment URL is silently dropped.
This commit is contained in:
parent
1589eb68b5
commit
46a5251316
3 changed files with 44 additions and 16 deletions
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue