Flarum (2.x)
    Preparing search index...
    • The highlight helper searches for a word phrase in a string, and wraps matches with the tag.

      Parameters

      • string: string

        The string to highlight.

      • Optionalphrase: string | RegExp

        The word or words to highlight.

      • Optionallength: number

        The number of characters to truncate the string to. The string will be truncated surrounding the first match.

      • safe: boolean = false

        Whether the string is HTML to be rendered as-is, or plain text to be escaped (HTML entities encoded). In HTML, only text is highlighted: tags and attributes are left untouched.

      Returns string | Vnode<any, any>