Interface Commenter

Apply this to a TagDecoder function to get commenting support.

interface Commenter {
    comment(tag: Tag, opts: Required, depth: number): string;
    noChildren?: boolean;
}

Properties

Methods

Properties

noChildren?: boolean

If true, do not output text for child nodes. The comment function will handle that. If true, ensure that the text returned by the comment function ends in a newline.

false

Methods

  • When commenting on this tag, if this function returns a string, it will be appended after the tag number and a colon.

    Parameters

    • tag: Tag

      The tag to comment on.

    • opts: Required

      Options.

    • depth: number

      How deep are we in indentation clicks so far?

    Returns string