Skip to content

Addition of x characters causes final x characters in <p> tag to be removed #66

@simonhrogers

Description

@simonhrogers

Hello!

I adore this package it is invaluable, thank you so much for your work.

I’ve got the following replacement in a project:

smartquotes.replacements.push([/([0-9])–([0-9])/g, '$1\u200a–\u200a$2'])

and it is causing the following string to be editing from this:

A solo exhibition by Ndaye Kouagou opening on 21 September 2023 at 6–8 pm.

to this:

A solo exhibition by Ndaye Kouagou opening on 21 September 2023 at 6 – 8 p

As you can see, the hair spaces are correctly inserted, but the final two characters of the p tag are inexplicably removed.

This happens whether I paste the hair space character or use the regex unicode. It happens with regular spaces too; the problem seems to be unique to the en-dash character. It happens at the end of the P tag, whether or not there are subsequent P tags.

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