summaryrefslogtreecommitdiff
path: root/emitter.py
diff options
context:
space:
mode:
authorJohn Stark <jhnstrk@gmail.com>2023-01-05 20:40:13 +0100
committerJohn Stark <jhnstrk@gmail.com>2023-01-05 20:40:13 +0100
commit0db66d2aa3c5abe79e55017435894898a2ebe898 (patch)
treee33e6d7bb7eb448302b3299545657203caf371f0 /emitter.py
parent45111ba0b67e8619265d89f3202635e62c13cde6 (diff)
downloadruamel.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.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/emitter.py b/emitter.py
index f9611ee..2a0d3ca 100644
--- a/emitter.py
+++ b/emitter.py
@@ -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