Skip to content
Anjunar/ DOCS

Links

Links are inline containers with a URL validated before it reaches the document.

Concept

Target and content

A LinkNode can contain marked text. LinkUrlPolicy validates both command input and imported links, so neither path can bypass the URL rule.

Follow the structure

Inspect how a link becomes an inline node with text beneath it.

7 words · 6 nodes
ember.core.root/1 [document] ember.rich-text.paragraph/1 [links5] ember.core.text/1 [links1] "A " ember.link.link/1 [links3] ember.core.text/1 [links2] "strong link" ember.core.text/1 [links4] " sits beside ordinary text."
Source

Validate, then dispatch

SetLink takes a LinkTarget, never a raw String; RemoveLink unwraps the selected link.

scala
val policy = LinkUrlPolicy.default policy.parse("https://anjunar.com/docs").foreach { url => session.dispatch(LinkCommands.SetLink, LinkTarget(url, Some("Documentation"))) } session.dispatch(LinkCommands.RemoveLink)