Module
PuduLangDocgen.Markdown.Lexicon
Character references, short codes, tags, and web addresses
Functions
| Name | Description |
|---|---|
slice |
Text of the characters in a half-open range. |
blank |
Whether a character counts as white space between words. |
entity |
A decoded character reference at an index and the index after it. |
emoji |
The emoji a `:name:` short code at an index stands for, and the index after it. |
address |
A bare web address starting with `http://`, `https://`, or `www.`, and the index after it. Trailing punctuation and unbalanced closing parentheses stay outside the address. |
autolink |
Whether text inside angle brackets is an autolink, answering its destination. |
tag |
Allowed inline HTML rebuilt without attributes other than `title`, or none for other tags. |
attribute |
The double-quoted value of a named attribute inside a tag, or the empty text. |
slice
fn slice(cs: &Array[Char], from: Int, to: Int) -> Str
Text of the characters in a half-open range.
Parameters
cs&Array[Char]fromInttoInt
Returns
Str
blank
fn blank(character: Char) -> Bool
Whether a character counts as white space between words.
Parameters
characterChar
Returns
Bool
entity
fn entity(cs: &Array[Char], index: Int, to: Int) -> Option[(Str, Int)]
A decoded character reference at an index and the index after it.
Parameters
cs&Array[Char]indexInttoInt
Returns
Option[(Str, Int)]
emoji
fn emoji(cs: &Array[Char], index: Int, to: Int) -> Option[(Str, Int)]
The emoji a :name: short code at an index stands for, and the index after it.
Parameters
cs&Array[Char]indexInttoInt
Returns
Option[(Str, Int)]
address
fn address(cs: &Array[Char], index: Int, to: Int) -> Option[(Str, Int)]
A bare web address starting with http://, https://, or www., and the index after it.
Trailing punctuation and unbalanced closing parentheses stay outside the address.
Parameters
cs&Array[Char]indexInttoInt
Returns
Option[(Str, Int)]
autolink
fn autolink(inner: Str) -> Option[Str]
Whether text inside angle brackets is an autolink, answering its destination.
Parameters
innerStr
Returns
Option[Str]
tag
fn tag(inner: Str) -> Option[Str]
Allowed inline HTML rebuilt without attributes other than title, or none for other tags.
Parameters
innerStr
Returns
Option[Str]
attribute
fn attribute(element: Str, name: Str) -> Str
The double-quoted value of a named attribute inside a tag, or the empty text.
Parameters
elementStrnameStr
Returns
Str