YAML Filter segments plain scaler values containing :'# incorrectly

Issue #631 new
Alex Spurling created an issue

Given the following YAML:

foo:
  bar: selected color:'#FFCC0A'
  bar2: selected color:'FFCC0A'

The filter produces:

<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:okp="okapi-framework:xliff-extensions" xmlns:its="http://www.w3.org/2005/11/its" xmlns:itsxlf="http://www.w3.org/ns/its-xliff/" its:version="2.0">
<file original="example.yml" source-language="en-US" target-language="fr-FR" datatype="x-text/x-yaml">
<body>
<group id="sg1">
<group id="sg2">
<trans-unit id="tu1" resname="foo/bar" xml:space="preserve">
<source xml:lang="en-US">selected color:'</source>
<target xml:lang="fr-FR">selected color:'</target>
</trans-unit>
<trans-unit id="tu2" resname="foo/bar2" xml:space="preserve">
<source xml:lang="en-US">selected color:'FFCC0A'</source>
<target xml:lang="fr-FR">selected color:'FFCC0A'</target>
</trans-unit>
</group>
</group>
</body>
</file>
</xliff>

I would expect the two values 'bar' and 'bar2' to be segmented in the same way. The 'hash' in the first value is being treated as a comment despite the fact that it is not preceded by a whitespace character. Also for some reason, this issue only appears if the characters preceding the hash are colon and quote (either single or double). Any other combination of characters works as expected.

This affects the latest version. I tested on dev branch with commit 091bc867.

Comments (3)

  1. Log in to comment