Flarum (v2.0.0-beta.5)
    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 content is safe to render as HTML or should be escaped (HTML entities encoded).

      Returns string | Vnode<any, any>