Skip to content

Commit

Permalink
Set indent-with-indicator before indicator-indent in dumper options (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
noonian authored Nov 22, 2024
1 parent ca228f2 commit f01e8f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/clojure/clj_yaml/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
(.setDefaultFlowStyle dumper (flow-styles flow-style)))
(when indent
(.setIndent dumper indent))
(when indicator-indent
(.setIndicatorIndent dumper indicator-indent))
(when indent-with-indicator
(.setIndentWithIndicator dumper indent-with-indicator))
(when indicator-indent
(.setIndicatorIndent dumper indicator-indent))
dumper))

(defn default-loader-options
Expand Down
15 changes: 14 additions & 1 deletion test/clj_yaml/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,20 @@ lol: yolo")
:dumper-options {:indent 5
:indicator-indent 2
:indent-with-indicator true
:flow-style :block})))))
:flow-style :block})))
(is (= (str "todo:\n"
;12
" issues:\n"
;; 12
" - name: Fix all the things\n"
" responsible:\n"
;; 12
" name: Rita\n")
(generate-string (parse-string indent-yaml)
:dumper-options {:indent 2
:indicator-indent 2
:indent-with-indicator true
:flow-style :block})))))

(def yaml-with-unknown-tags "---
scalar: !CustomScalar some-scalar
Expand Down

0 comments on commit f01e8f8

Please sign in to comment.