Skip to content

Commit

Permalink
fix: Allow non-ASCII values in all attributes
Browse files Browse the repository at this point in the history
PR ietf-tools#1017 allowed Unicord characters everywhere.
This fixes a bug that xml2rfc was guarding against non-ASCII characters
in attribute values.
With `--warn-bare-unicode`, xml2rfc will warn if non-ASCII characters are
present in attribute values.

Fixes ietf-tools#1105
  • Loading branch information
kesara committed Feb 20, 2024
1 parent ec6d921 commit 31bfab7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xml2rfc/writers/preptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ def check_attribute_values(self, e, p):
if (c.tag, a) in latinscript_attributes:
if not is_script(v, 'Latin'):
self.err(c, 'Found non-Latin-script content in <%s> attribute value %s="%s"' % (c.tag, a, v))
else:
if self.options.warn_bare_unicode:
if not isascii(v):
self.err(c, 'Found non-ASCII content in <%s> attribute value %s="%s"' % (c.tag, a, v))
self.warn(c, f'Found non-ASCII content in {c.tag} attribute value {a}="{v}" that should be inspected to ensure it is intentional.')
if not (c.tag, a) in space_attributes:
vv = v.strip()
if vv != v:
Expand Down

0 comments on commit 31bfab7

Please sign in to comment.