From 601719d71523d1dfdaf929e2d49e8a6ae5d46d13 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Mon, 1 Jan 2018 20:57:44 +0100 Subject: [PATCH] Fix call to markdown parser to work with eXist 3.6.0 --- .existdb.json | 20 ++++++++++++++++++++ modules/atomic.xql | 6 +++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .existdb.json diff --git a/.existdb.json b/.existdb.json new file mode 100644 index 0000000..bbc0569 --- /dev/null +++ b/.existdb.json @@ -0,0 +1,20 @@ +{ + "servers": { + "localhost": { + "server": "http://localhost:8080/exist", + "user": "admin", + "password": "" + } + }, + "sync": { + "server": "localhost", + "root": "/db/apps/wiki", + "active": true, + "ignore": [ + ".existdb.json", + ".git/**", + "node_modules/**", + "bower_components/**" + ] + } +} diff --git a/modules/atomic.xql b/modules/atomic.xql index 6faa315..707359b 100644 --- a/modules/atomic.xql +++ b/modules/atomic.xql @@ -44,7 +44,7 @@ declare function atomic:process-img($node as element()) { $config:base-url || $src else $src - + return element { node-name($node) } { $node/@* except ($node/@alt, $node/@src, $node/@class), @@ -101,7 +101,7 @@ declare function atomic:get-content($content as element(atom:content)?, $eval as xs:anyURI($path) case "markdown" return let $text := util:binary-to-string(util:binary-doc($path)) - let $parsed := md:parse($text, $atomic:MD_CONFIG) + let $parsed := md:parse($text, ($md:HTML-CONFIG, $atomic:MD_CONFIG)) return
{$parsed}
default return @@ -111,7 +111,7 @@ declare function atomic:get-content($content as element(atom:content)?, $eval as case "html" case "xhtml" return $content/* case "markdown" return -
{md:parse($content/string(), $atomic:MD_CONFIG)}
+
{md:parse($content/string(), ($md:HTML-CONFIG, $atomic:MD_CONFIG))}
default return $content/node() return