diff options
author | John Stark <jhnstrk@gmail.com> | 2023-01-05 20:40:13 +0100 |
---|---|---|
committer | John Stark <jhnstrk@gmail.com> | 2023-01-05 20:40:13 +0100 |
commit | 0db66d2aa3c5abe79e55017435894898a2ebe898 (patch) | |
tree | e33e6d7bb7eb448302b3299545657203caf371f0 /emitter.py | |
parent | 45111ba0b67e8619265d89f3202635e62c13cde6 (diff) | |
download | ruamel.yaml-0db66d2aa3c5abe79e55017435894898a2ebe898.tar.gz |
Fix secondary tag encoding. See #449449_secondary_tag_url_enc
The second exclamation mark was getting url encoded, when it
should be preserved. Added a regression test.
Diffstat (limited to 'emitter.py')
-rw-r--r-- | emitter.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -97,6 +97,7 @@ class Emitter: DEFAULT_TAG_PREFIXES = { '!': '!', 'tag:yaml.org,2002:': '!!', + '!!': '!!', } # fmt: on @@ -1012,7 +1013,7 @@ class Emitter: # type: (Any) -> Any if not tag: raise EmitterError('tag must not be empty') - if tag == '!': + if tag == '!' or tag == '!!': return tag handle = None suffix = tag |