Skip to content

Replace react-content-marker with a regexp#3014

Merged
mathjazz merged 4 commits into
mozilla:mainfrom
eemeli:better-marks
Nov 10, 2023
Merged

Replace react-content-marker with a regexp#3014
mathjazz merged 4 commits into
mozilla:mainfrom
eemeli:better-marks

Conversation

@eemeli
Copy link
Copy Markdown
Member

@eemeli eemeli commented Nov 9, 2023

Fixes #2515
Fixes #3006

Ports all the rules from react-content-marker into an inlined implementation. Results are cleaner, more efficient, and less buggy. Also, for placeholders we now match the rules used in the editor highlighting.

In a few places the rules are relaxed a bit and/or made more sane, but these are unlikely to actually effect real-world messages noticably. Except where they fix current bugs. Also, the placeholder rules now match the editor.

@eemeli eemeli requested a review from mathjazz November 9, 2023 02:22
Copy link
Copy Markdown
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a regression in string and concordance search - highlighting of placeables takes priority over highlighting the search match. It should be the other way around, because when searching, you care about search matches more:

https://pontoon.mozilla.org/sl/firefox/all-resources/?search=brand-full&string=192278

Other than that:

Comment thread translate/public/locale/en-US/translate.ftl Outdated
@eemeli eemeli requested a review from mathjazz November 9, 2023 23:48
Copy link
Copy Markdown
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@mathjazz mathjazz merged commit b2d4cbc into mozilla:main Nov 10, 2023
@eemeli eemeli deleted the better-marks branch November 10, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle all placeables using internal logic used in the editor Placeholders in XLIFF files are not clickable in source strings

2 participants