Type alias MatchOptions

MatchOptions: {
    traverseAll: boolean;
}

Type declaration

  • traverseAll: boolean

    If true, the pattern matching can begin within child nodes given to match and matchAll.

    Default

    false
    

    Example

    const texString = 'a $x + y$ b'
    const ast = lp.parse(texString)
    const pat = lp.pattern(lp.isMathCharacter)
    const result = pat.match(ast.content) // undefined

    Example

    const texString = 'a $x + y$ b'
    const ast = lp.parse(texString)
    const pat = lp.pattern(lp.isMathCharacter)
    const result = pat.match(ast.content, {traverseAll: true})
    result?.node.content // 'x'

Generated using TypeDoc