Skip to content

regex is replacing only first \n occurence #56

@danielovadia

Description

@danielovadia

In line 50 on index.js, there's a regex replacement from\nto <br>
The issue is that the regex is not using the g modifier - which causing only the first \n occurrence to be replaced.
to fix that, there's a need to change
_html: (title || '').replace(/<[^>]+>/g).replace(/\n/, '<br>')
to
_html: (title || '').replace(/<[^>]+>/g).replace(/\n/g, '<br>')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions