Skip to main content

Module text_spans

Module text_spans 

Source
Expand description

Inline annotations a sender writes as markup and the wire carries as tags: colour (text_color) and times (text_time). Core takes the markup out at every send and edit; each span names a char range of the plain content that other clients read.

Re-exports§

pub use crate::text_color::ColorSpan;
pub use crate::text_time::TimeSpan;

Enums§

TextSpan

Functions§

extract
Take the markup out of content: colour tags, then <t:…> times. Returns the plain text and its spans, offsets in chars of that text.
extract_own
extract for something this account sends or edits: the colour markup still comes out, but its colour only rides along with the Text Effects perk.
from_stored
The spans in a stored event’s tags, checked against its content.
from_tags
The spans a rumor’s tags carry, checked against its content.
to_nostr_tags
The spans as rumor tags.