Opened on 12/10/2015 at 07:42:37 AM

Closed on 03/20/2016 at 03:31:21 PM

#3402 closed defect (fixed)

[CMS] Fix inline tag nesting for translatable strings

Reported by: saroyanm Assignee: kzar
Priority: P3 Milestone:
Module: Sitescripts Keywords: cms
Cc: Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29332956/

Description (last modified by kzar)

Background

Our CMS allows some inline HTML tags (a, em, sup, strong, code, span) inside of translatable strings, they can even be nested.

Unfortunately nesting appears to be broken depending on the order of the tags. For example either <em><sup>example</sup></em> or <sup><em>example</em></sup> will work but not both. For one the outer tags will be HTML escaped. (To make matters worse the whitelisted tags are stored inside an unordered set, so we can't even be sure of which of the two will work!)

What to change

Make relevant changes to cms/converters.py so that nesting of whitelisted HTML tags works despite the order in which they are nested. With the example string Hello world <sup><a href="#ref">1</a></sup> the opening and closing sup tags should not be escaped.

Attachments (0)

Change History (7)

comment:1 Changed on 12/22/2015 at 11:37:11 AM by kzar

  • Description modified (diff)
  • Keywords cms added
  • Owner set to kzar
  • Priority changed from Unknown to P3
  • Ready set
  • Summary changed from Allow nested inline tags in translation string to [CMS] Allow links inside of inline tags for translatable strings

Note: Nested inline tags work generally, as a work around you could do something like this: <a href="#ref"><sup>1</sup></a>

comment:2 Changed on 12/22/2015 at 11:47:05 AM by kzar

  • Description modified (diff)

comment:3 Changed on 12/22/2015 at 12:44:33 PM by kzar

  • Description modified (diff)
  • Summary changed from [CMS] Allow links inside of inline tags for translatable strings to [CMS] Fix inline tag nesting for translatable strings
  • Type changed from change to defect

comment:4 Changed on 12/22/2015 at 12:57:20 PM by kzar

  • Description modified (diff)

comment:5 Changed on 12/22/2015 at 01:52:45 PM by kzar

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:6 Changed on 03/20/2016 at 03:23:34 PM by abpbot

A commit referencing this issue has landed:
https://hg.adblockplus.org/cms/rev/2749081ea158

comment:7 Changed on 03/20/2016 at 03:31:21 PM by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from kzar.
 
Note: See TracTickets for help on using tickets.