From 0861b0c8dac4095e1bc2cfb622719a5e24cb1d2b Mon Sep 17 00:00:00 2001 From: Nico Rikken Date: Mon, 28 Aug 2017 20:36:16 +0200 Subject: [PATCH] fix: asciidoc yaml parsing Fixes the issue as described in https://github.com/hashobject/perun/issues/192 by checking the triple dash to be prefixed by either the start of the document, or the start of a new line. This does still allow for some content before the actual yaml. --- src/io/perun/yaml.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io/perun/yaml.clj b/src/io/perun/yaml.clj index 3ce30b72..0d562959 100644 --- a/src/io/perun/yaml.clj +++ b/src/io/perun/yaml.clj @@ -7,7 +7,7 @@ (:import [flatland.ordered.map OrderedMap] [flatland.ordered.set OrderedSet])) -(def ^:dynamic *yaml-head* #"---\r?\n") +(def ^:dynamic *yaml-head* #"(?<=^|\n)---\r?\n") (defn substr-between "Find string that is nested in between two strings. Return first match.