A strong link sits beside ordinary text.
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 [follow-the-structure5]
ember.core.text/1 [follow-the-structure1] "A "
ember.link.link/1 [follow-the-structure3]
ember.core.text/1 [follow-the-structure2] "strong link"
ember.core.text/1 [follow-the-structure4] " 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://example.com/docs").foreach { url =>
session.dispatch(LinkCommands.SetLink, LinkTarget(url, Some("Documentation")))
}
session.dispatch(LinkCommands.RemoveLink)