Defined in: lib/HTMLSerializer__LinkResolver.js
| String | lookup() |
| String | linkify(String) |
| String | renderLink(Object, Object) |
Linkify all internal links found in a block of text.
docstring | StringThe block of text possibly containing internal links. |
StringThe text with all the internal links that were successfully resolved replaced with markdown-formatted links. |
Example
LinkResolver.linkify('See [Module]() for more info.');
// => "See [ModuleTitle](/internal/path/to/module) for more info."Look up an item and generate a URL to it, if found.
params.path | StringThe index path. |
params.contextNode | T.NodeThe node we're resolving from. |
link | Object |
link.href | String |
link.title | String |
params | Object |
params.contextNode | T.Node |
params.strict | BooleanWill warn when enabled and the link could not be resolved. Defaults to: |
params.format | StringOne of "html" or "markdown". |
descriptor | Object |
descriptor.source | StringThe source string that generated this link. This must be present so that we can use it if the link could not be resolved, in which case we'll use it as a text for a "broken" anchor that will be highlighted in the UI. |
descriptor.path | StringThe index path to resolve. |
descriptor.text | StringWill be used as the anchor's text. If not specified, we'll use the document's title in its place. |
descriptor.title | StringWill be used as the anchor's [title] attribute (a tooltip). If not specified, we'll use the document's summary in its place. |
String |
Made with ♥ using megadoc.