diff --git a/yaml/parser.nim b/yaml/parser.nim index faaabdb..9f868c5 100644 --- a/yaml/parser.nim +++ b/yaml/parser.nim @@ -1090,14 +1090,14 @@ proc anchorName*(p: YamlParser, anchor: AnchorId): string {.raises: [].} = proc renderAttrs(p: YamlParser, tag: TagId, anchor: AnchorId, isPlain: bool): string = result = "" + if anchor != yAnchorNone: result &= " &" & p.anchorName(anchor) case tag of yTagQuestionmark: discard of yTagExclamationmark: when defined(yamlScalarRepInd): if isPlain: result &= " " else: - result = "<" & p.taglib.uri(tag) & ">" - if anchor != yAnchorNone: result &= " &" & p.anchorName(anchor) + result = " <" & p.taglib.uri(tag) & ">" proc display*(p: YamlParser, event: YamlStreamEvent): string {.raises: [KeyError].} = diff --git a/yaml/stream.nim b/yaml/stream.nim index 1ac4e65..afed9ea 100644 --- a/yaml/stream.nim +++ b/yaml/stream.nim @@ -251,11 +251,11 @@ proc `==`*(left: YamlStreamEvent, right: YamlStreamEvent): bool {.raises: [].} = proc renderAttrs(tag: TagId, anchor: AnchorId): string = result = "" + if anchor != yAnchorNone: result &= " &" & $anchor case tag of yTagQuestionmark: discard of yTagExclamationmark: result &= " !" else: result &= " <" & $tag & ">" - if anchor != yAnchorNone: result &= " &" & $anchor proc `$`*(event: YamlStreamEvent): string {.raises: [].} = ## outputs a human-readable string describing the given event.