Module

PuduLangDocgen.Markdown.Lexicon

View source

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]
from
Int
to
Int

Returns

Str

View source

blank

fn blank(character: Char) -> Bool

Whether a character counts as white space between words.

Parameters

character
Char

Returns

Bool

View source

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]
index
Int
to
Int

Returns

Option[(Str, Int)]

View source

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]
index
Int
to
Int

Returns

Option[(Str, Int)]

View source

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]
index
Int
to
Int

Returns

Option[(Str, Int)]

View source

fn autolink(inner: Str) -> Option[Str]

Whether text inside angle brackets is an autolink, answering its destination.

Parameters

inner
Str

Returns

Option[Str]

View source

tag

fn tag(inner: Str) -> Option[Str]

Allowed inline HTML rebuilt without attributes other than title, or none for other tags.

Parameters

inner
Str

Returns

Option[Str]

View source

attribute

fn attribute(element: Str, name: Str) -> Str

The double-quoted value of a named attribute inside a tag, or the empty text.

Parameters

element
Str
name
Str

Returns

Str

View source