Maven Shared Components

[PATCH] quote handling in linkPatternedText seems broken

Details

  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    3

Description

MPIR-59 shows a problem on a quote for french translation : an easy workaround is to double the quote '', but these 2 quotes are rendered in the final report, which is not what is expected.

Then I checked the correponding code, and found inconsistencies in the way quotes are handled (apparently to protect braces from being interpreted).
I wrote a JUnit test to show these inconsistencies (which in addition showed some bugs on special situations).

To get consistent results, I think that single quotes should be removed when found: that's what is done in the patch.
But doing so, there will be problems with existing texts that contain only one single quote: what used to work won't work any more, because the quote should be doubled (and not let without a closing quote).

Should this patch be applied or not ? I really don't know: without it, you can have weird results (showed in the JUnit test). But when applying it, prepare yourself to some problems with existing texts: I can't say how much content it will break...

At least, adding the JUnit test to the codebase will help to deal with the current situation.

Issue Links

Activity

Hide
Herve Boutemy added a comment -

I worked on a new patch that:
1. fix what can be fixed: braces stacking, double quote handling,
2. but does not change the overall behavior: simple quotes are not removed any more, unmatched quotes are simply ignored
3. and does not change applyPattern() method access scope (using junit-addons to access private method in the JUnit test)

then this patch can be applied safely: it won't break existing texts

Show
Herve Boutemy added a comment - I worked on a new patch that: 1. fix what can be fixed: braces stacking, double quote handling, 2. but does not change the overall behavior: simple quotes are not removed any more, unmatched quotes are simply ignored 3. and does not change applyPattern() method access scope (using junit-addons to access private method in the JUnit test) then this patch can be applied safely: it won't break existing texts
Hide
Jason van Zyl added a comment -

Patch applied. Thanks.

Show
Jason van Zyl added a comment - Patch applied. Thanks.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: