encoder_lua: Improve Tag handling robustness

Using the method call seems more reliable in case the input parser
forgets to set the tag.
This commit is contained in:
Kim Alvefur 2023-10-04 14:10:39 +02:00
parent e709a583f4
commit 58a95948ca

View File

@ -270,7 +270,7 @@ func (le *luaEncoder) encodeAny(writer io.Writer, node *yaml.Node) error {
case yaml.MappingNode:
return le.encodeMap(writer, node, false)
case yaml.ScalarNode:
switch node.Tag {
switch node.ShortTag() {
case "!!str":
return le.encodeString(writer, node)
case "!!null":