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

nlp-plugin-html: Render links with () #358

Open
waldenn opened this issue Apr 30, 2020 · 3 comments
Open

nlp-plugin-html: Render links with () #358

waldenn opened this issue Apr 30, 2020 · 3 comments
Labels
Projects

Comments

@waldenn
Copy link
Contributor

waldenn commented Apr 30, 2020

Example article containing many such links: James Thomson

Only the links not containing parentheses are rendered correctly, the others are rendered as plain text.

There could be some additional characters which also that prevent links from rendering, but parentheses are quite common in wiki titles as a disambiguation method.

@waldenn waldenn changed the title links containing parenthesis are not displayed as a link links containing parentheses are not displayed as a link Apr 30, 2020
@spencermountain
Copy link
Owner

ah, good find.
will take a look next week. Code is here if anyone wants to do a pr

@spencermountain spencermountain changed the title links containing parentheses are not displayed as a link nlp-plugin-html: Render links with () Apr 30, 2020
@spencermountain
Copy link
Owner

spencermountain commented Apr 30, 2020

ah, just took a look - it's that a \b wildcard doesn't like being beside the parentheses.
We may need to swap the \b in ./_lib/smartReplace.js with something like this:

(?<!\w)\(jadad\)(?!\w)

these look-beind regexes are not very-well supported yet.

@waldenn
Copy link
Contributor Author

waldenn commented May 1, 2020

Thanks, pity "look-behind" is still not supported both on Firefox and Safari. Maybe there are other ways of handling this bug in a special-case regexp replace function when parentheses are encountered? Have not looked at the code yet though.

@spencermountain spencermountain added this to To do in v9 Dec 29, 2020
@spencermountain spencermountain moved this from To do to In progress in v9 Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
v9
  
In progress
Development

No branches or pull requests

2 participants