pub struct WikiLink {
pub meta: NodeMeta,
pub target: String,
pub label: String,
pub embed: bool,
}Expand description
A wiki link: [[target|label]], or an embed: ![[target|label]].
Fields§
§meta: NodeMetaNode metadata (source span). An embed’s span starts at its !.
target: StringThe link target (page name) as written in the source, its backslash
escapes and character references kept; WikiLink::decoded_target
gives the text they stand for.
label: StringThe visible label as written in the source, its backslash escapes and
character references kept; WikiLink::decoded_label gives the text
they stand for. A label equal to target means the link is written
without a |label part.
embed: boolWhether a ! directly before the [[ marks the link as an embed.
Implementations§
Source§impl WikiLink
impl WikiLink
Sourcepub fn decoded_target(&self) -> String
pub fn decoded_target(&self) -> String
The target with its backslash escapes and character references
decoded, as CommonMark decodes a link destination: a \| b & c
decodes to a | b & c.
Sourcepub fn decoded_label(&self) -> String
pub fn decoded_label(&self) -> String
The label with its backslash escapes and character references
decoded, as WikiLink::decoded_target decodes the target.