Types
MargraveParserVarMatcher = distinct var MargraveParser
- Source Edit
Procs
proc addNewline(parser: MargraveParser; options: static MargraveOptions; elem: MargraveElement | seq[MargraveElement])
- Source Edit
func anyNext(parser: MargraveParser; offset: int = 0): bool {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func anyPrev(parser: MargraveParser; offset: int = 0): bool {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func escapeHtmlChar(ch: char): NativeString {....raises: [], tags: [], forbids: [].}
- Escapes &, < and > for html. Source Edit
func nextMatch(parser: var MargraveParser; pat: char; offset: int = 0): bool {. ...raises: [], tags: [], forbids: [].}
- Source Edit
func nextMatch(parser: var MargraveParser; pat: char; offset: int = 0; len: int): bool {. ...raises: [], tags: [], forbids: [].}
- Source Edit
func nextMatch(parser: var MargraveParser; pat: openArray[string]; offset: int = 0): bool {....raises: [], tags: [], forbids: [].}
- Source Edit
func nextMatch(parser: var MargraveParser; pat: set[char]; offset: int = 0): bool {. ...raises: [], tags: [], forbids: [].}
- Source Edit
func nextMatch(parser: var MargraveParser; pat: set[char]; offset: int = 0; len: int): bool {....raises: [], tags: [], forbids: [].}
- Source Edit
func nextMatch(parser: var MargraveParser; pat: string; offset: int = 0): bool {. ...raises: [], tags: [], forbids: [].}
- Source Edit
func nextWhitespace(parser: MargraveParser; offset: int = 0): bool {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func noAdjacentWhitespace(parser: MargraveParser; offset: int = 0): bool {. inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func onlyNextWhitespace(parser: MargraveParser; offset: int = 0): bool {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func onlyPrevWhitespace(parser: MargraveParser; offset: int = 0): bool {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func peekMatch(parser: MargraveParser; pat: char; offset: int = 0): bool {. inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func peekMatch(parser: MargraveParser; pat: char; offset: int = 0; len: Natural): bool {. inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func peekMatch(parser: MargraveParser; pat: openArray[string]; offset: int = 0): bool {. inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func peekMatch(parser: MargraveParser; pat: set[char]; offset: int = 0): bool {. inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func peekMatch(parser: MargraveParser; pat: set[char]; offset: int = 0; len: Natural): bool {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func peekMatch(parser: MargraveParser; pat: string; offset: int = 0): bool {. inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func peekPrevMatch(parser: MargraveParser; pat: char | set[char]; offset: int = 0): bool {.inline.}
- Source Edit
func peekPrevMatch(parser: MargraveParser; pat: string; offset: int = 0): bool {. inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
func prevWhitespace(parser: MargraveParser; offset: int = 0): bool {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
proc setLink(parser: MargraveParser; options: static MargraveOptions; elem: MargraveElement; link: Link)
- Calls setLink if no setLinkHandler callback, otherwise calls callback Source Edit
proc setLinkDefault(elem: MargraveElement; link: Link) {....raises: [], tags: [], forbids: [].}
-
Sets element link.
If elem has tag a, sets the href attribute to link. Otherwise if elem has tag img and link ends with .mp4, .m4v, .mov, .ogv or .webm, elem will become a video element, and if link ends with .mp3, .oga, .ogg, .wav or .flac, elem will become an audio element; then the src attribute will be set to link. Other tags for elem also set the src attribute to link.
Source Edit func surroundedWhitespace(parser: MargraveParser; offset: int = 0): bool {. inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
Iterators
iterator nextChars(parser: var MargraveParser): char {....raises: [], tags: [], forbids: [].}
- Source Edit
Macros
macro match(parserMatcher: MargraveParserVarMatcher): untyped
- Source Edit
macro matchNext(parser: var MargraveParser; branches: varargs[untyped])
- Source Edit
Templates
template `case`(parserMatcher: MargraveParserVarMatcher): untyped
- Source Edit
template get(parser: MargraveParser; offset: int = 0): char
- Source Edit
template get(parser: MargraveParser; offset: int = 0; len: int): NativeString
- Source Edit
template nextMatch(parser: var MargraveParser): MargraveParserVarMatcher
- Source Edit
template noNext(parser: MargraveParser; offset: int = 0): bool
- Source Edit
template noPrev(parser: MargraveParser; offset: int = 0): bool
- Source Edit
template withOptions(parser: MargraveParser; compileTimeOptions: static MargraveOptions; cond, body): untyped
- Source Edit
template withOptions(parser: MargraveParser; compileTimeOptions: static MargraveOptions; cond, body, elseBody): untyped
- Source Edit