Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect quote parsing with footnotes #134

Closed
mundschenk-at opened this issue May 9, 2020 · 4 comments · Fixed by #170
Closed

Incorrect quote parsing with footnotes #134

mundschenk-at opened this issue May 9, 2020 · 4 comments · Fixed by #170
Assignees
Labels
Milestone

Comments

@mundschenk-at
Copy link
Owner

Reported as a comment on the wp-Typography webpage: à "l’âge" <sup><a>N112</a></sup> is rendered à&nbsp;«&nbsp;l’âge«&nbsp;<sup><a>N112</a></sup>. To fix this, the algorithm would have to take the adjacent element into account, not only adjacent text.

@mundschenk-at mundschenk-at self-assigned this May 9, 2020
@mundschenk-at mundschenk-at added this to the 7.0.0 milestone Mar 21, 2024
@mundschenk-at
Copy link
Owner Author

Not currently reproducibly on 7.0.0-dev, original support ticket author asked for clarification.

@belbernard
Copy link

Hello, look at my page https://lebonheurestpossible.org/vivre-longtemps/
Near bottom of text, occurrence  of « New-Age ». You can see that the closing quote is displayed '«' instead of '»'.
The HTML code is  "New-Age"<sup><a ... etc.
The '<' sign of "<sup>" should be identified as an end of word, just like any punctuation mark.

@mundschenk-at
Copy link
Owner Author

Thank you @belbernard for the clarification. However, that is not how the processing works. The HTML is parsed using a DOM parser and then PHP-Typography just looks at the textnodes in the DOM, not at individual characters.

I have locally implemented support for properly recognizing <br> as whitespace, and stopping parsing at <sup> or <sub> nodes could be implemented as well, but when I've added these snippets to my tests, they already are parsed correctly: 'à "l’âge"<sup>N112</sup>' results in '&agrave; &laquo;&#8239;l&rsquo;&acirc;ge&#8239;&raquo;<sup>N112</sup>'

@mundschenk-at
Copy link
Owner Author

Never mind, I think I found an issue with the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants