src/quill/utils

Procs

proc `[]=`(parent: Element; i: int; child: Node) {....raises: [], tags: [].}
Set child i of parent to child
func `[]`[T, U](s: cstring; i: HSlice[T, U]): cstring
Slice a cstring
proc clear(e: Element) {.importcpp: "#.innerHTML = \'\'", ...raises: [], tags: [].}
Clear an dom element
proc createRawText(str: string): Node {....raises: [], tags: [].}
proc innerHTML(e: Element): cstring {.importcpp: "#.innerHTML", ...raises: [],
                                      tags: [].}
Get the inner html of a dom element
proc innerHTML=(e: Element; s: cstring) {.importcpp: "#.innerHTML = #",
    ...raises: [], tags: [].}
Set the inner html of a dom element
proc lastChild(e: Element): Node {.importcpp: "#.lastChild", ...raises: [],
                                   tags: [].}
Get the last child of a dom element
proc replace(tg: cstring; a: cstring; b: cstring): cstring {.
    importcpp: "#.replace(#, #)", ...raises: [], tags: [].}
Replace a for b in tg
proc selectionEnd(txtarea: Element): int {.importcpp: "#.selectionEnd",
    ...raises: [], tags: [].}
Direct wrapper
proc selectionStart(txtarea: Element): int {.importcpp: "#.selectionStart",
    ...raises: [], tags: [].}
Direct wrapper
proc toJsStr(s: string): cstring {....raises: [], tags: [].}
Turn a string into a cstring with no escaping

Templates

template toCstr(c: char): untyped
Turn a char into a cstring