Core: net.sf.okapi.common.resource.TextFragment#getRefMarker does not correctly obtain reference identifier containing square brackets

Issue #996 resolved
Denis Konovalyenko created an issue

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:

  1. end boundary or even both ones reconsideration: $#], {{#ref}} , {{/ref}}, etc.
  2. pre-escaping identifiers
  3. finding the last ] in the code data (might not work for all cases)

Comments (4)

  1. Chase Tingley

    My preference would be to look at #2 first. 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.

  2. Log in to comment