Core: net.sf.okapi.common.resource.TextFragment#getRefMarker does not correctly obtain reference identifier containing square brackets
Issue #996
resolved
The aforementioned method looks for [#$
character sequence as a reference start and for ]
character as a reference end. Thus, when a reference identifier contains ]
characters, it can’t be read in full. E.g. if a referent resource identifier is [1][2][3]
, then the method returns [1
only.
Possible ways of solving this can be:
- end boundary or even both ones reconsideration:
$#]
,{{#ref}}
,{{/ref}}
, etc. - pre-escaping identifiers
- finding the last
]
in the code data (might not work for all cases)
Comments (4)
-
-
reporter - changed milestone to 1.41.0
- edited description
-
reporter A related pull request #451 was opened.
-
reporter - changed status to resolved
The pull request #451 was merged.
- Log in to comment
My preference would be to look at
#2first. Our ref syntax is using internal escape characters, which usually means you need to escape those characters when they appear in the wild. Of course, then we will need to de-escape them as well.