Problem/Motivation
When we have a paragraph type which label contains a quote (or a few other special chars), its label ends up being double escaped in the buttons title. That's because Drupal.t() converts these chars to htmlentities (to mirror what's done in PHP) then Element.setAttribute() escapes that value again because it does not expect to get any HTML.
Steps to reproduce
- Create a paragraph type which label contains a quote
- Configure one content type to allow to reference this paragraph type
- Configure the widget to show the add in between buttons
Expected: the button's title attribute is human readable
Current: the button's title attribute contains escaped html entities
Proposed resolution
Use a DOMParser trick to convert entities back before setting the button title.
Issue fork paragraphs_ee-3344007
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
duaelfrComment #4
duaelfrThis is also related to #3343428: Escaped quotes in add in between paragraphs labels which has the same issue on the button text.
Comment #8
stborchertThanks for the fix ... I accidentally used the wrong commit message so I added another commit with some more fixes and proper credits.