Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trang does not handle escaped quotes in strings properly #228

Open
chrispitude opened this issue Oct 20, 2018 · 1 comment
Open

trang does not handle escaped quotes in strings properly #228

chrispitude opened this issue Oct 20, 2018 · 1 comment

Comments

@chrispitude
Copy link

When there are escaped quotes in a string (the a:longName attribute here):

<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
 <start>
  <element name="xmlnsname" a:longName="XML namespace name (aka &quot;namespace URI&quot;)">
   <text/>
  </element>
 </start>
</grammar>

trang does not re-escape them to preserve them properly:

<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
  <start>
    <element name="xmlnsname" a:longName="XML namespace name (aka "namespace URI")">
      <text/>
    </element>
  </start>
</grammar>

The resulting output is no longer valid:

$ jing y.rng
/home/chrispy/dita-ot-3.1.3/plugins/org.oasis-open.dita.v1_3/rng/technicalContent/rng/y.rng:4:68: fatal: Element type "element" must be followed by either attribute specifications, ">" or "/>".
@sideshowbarker
Copy link
Contributor

Thanks for reporting this. I am planning to do a new release soon (see #231) but I unfortunately can’t make time myself to investigate and fix this issue any time soon. So if it’s important for you that a fix for this gets into the release, then we’re gonna need for somebody to make time to write up a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants