README

bobzhang/html_parser/linkify does not have a README file

#
LinkMatch

pub(all) struct LinkMatch {
start : Int
end : Int
text : String
href : String
kind : String
} derive(Eq,
Debug
)

A URL or email-like span found in plain text.

start and end are UTF-16 offsets into the input StringView. kind is "url" or "email".

#
LinkifyConfig

pub struct LinkifyConfig {
// private fields
} derive(
Debug
)

Options for the plain-text link scanner.

#
LinkifyConfig::new

fn LinkifyConfig::new(fuzzy_ip? : Bool, extra_tlds? : Array[String]) -> LinkifyConfig

Create a linkify scanner configuration.

fuzzy_ip enables bare IPv4 address matches such as 192.168.0.1. extra_tlds extends the default fuzzy domain and email TLD allowlist.

#
LinkifyConfig::with_extra_tlds

fn LinkifyConfig::with_extra_tlds(extra_tlds : Array[String]) -> LinkifyConfig

Create a linkify scanner configuration with additional fuzzy-link TLDs.
fn find_links(text : StringView) -> Array[LinkMatch]

Find URL and email-like spans in plain text using the default configuration.
fn find_links_with_config(text : StringView, config : LinkifyConfig) -> Array[LinkMatch]

Find URL and email-like spans in plain text using an explicit configuration.

#
linkify_default_dom_skip_tags

fn linkify_default_dom_skip_tags() -> Array[String]

Return the default element names whose descendants are not linkified.

The list includes existing anchors and text contexts where automatic link insertion would change code, raw text, or whitespace-preserving content.

#
linkify_dom

fn linkify_dom(node :
Node
, config? : LinkifyConfig, skip_tags? : Array[String]) ->
Node

Linkify URL and email text inside a DOM subtree.

The transform mutates and returns node. By default it skips existing anchors and whitespace-preserving tags (code, pre, script, style, and textarea), while still processing normal children such as template contents.

#
linkify_text_child_at_matches

fn linkify_text_child_at_matches(parent :
Node
, index : Int, child :
Node
, matches : Array[LinkMatch]) -> Int

Replace one text child with text and anchor nodes for precomputed matches.

matches must use UTF-16 offsets into child.data. The helper detaches the original child, inserts replacement nodes at index, preserves the parent's namespace for generated anchors, and returns the number of inserted nodes.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io