diff --git a/pretty.lua b/pretty.lua index f36a139..016c0e4 100644 --- a/pretty.lua +++ b/pretty.lua @@ -161,6 +161,9 @@ function pretty._process(input, config, processing_state) --drop depth processing_state.depth = processing_state.depth - 1 + --remove circular + circular_references[input] = nil + local multiline = #chunks > 1 local separator = (indent == "" or not multiline) and ", " or ",\n"..indent @@ -173,4 +176,4 @@ function pretty._process(input, config, processing_state) return "{" .. prelude .. table.concat(chunks, separator) .. "}" end -return pretty \ No newline at end of file +return pretty