docx-validate
    Preparing search index...

    Function getLineNumber

    • 1-based source line number for a parsed node, or 0 if the parser did not record one. @xmldom exposes lineNumber directly on Element/Attr nodes (zero-based-internally, but exposed 1-based) when the document was parsed from a string — matches Python's elem.sourceline.

      Use this everywhere instead of poking (node as any).lineNumber so callers cope cleanly with constructed-in-memory nodes (which have no source).

      Parameters

      • node: Node | null | undefined

      Returns number