Skip to content

If the user name contains any regex metacharacters, the ping highlighting does not work. #167

@jvert

Description

@jvert

The highlightPing() function uses the user's name directly as a regex when replacing the text with the tag button. This breaks if the user's name contains any regex special characters, e.g. "John Vert (me!)"

quick & simple fix is to change highlightPing to escape the username

html = html.replace(new RegExp(pingText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'), __createTag(pingText, userId));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions