From 9e6dab06cc2db8263fce083510ae570923b21c0b Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 19 Sep 2014 15:03:52 +0100 Subject: [PATCH] Fix problem with Maruku Markdown metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #855 - albeit it’s a bit of a kluge. The internal format returned by `markdown.toHTMLTree()` isn’t sufficiently well documented for me to be confident that the new code is resilient to all the things that might be returned. --- plugins/tiddlywiki/markdown/wrapper.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/tiddlywiki/markdown/wrapper.js b/plugins/tiddlywiki/markdown/wrapper.js index 2920da1f1..debd94c36 100644 --- a/plugins/tiddlywiki/markdown/wrapper.js +++ b/plugins/tiddlywiki/markdown/wrapper.js @@ -56,8 +56,9 @@ function transformNode(node) { var MarkdownParser = function(type,text,options) { var dialect = options.wiki.getTiddlerText(CONFIG_DIALECT_TIDDLER,DEFAULT_DIALECT), - markdownTree = markdown.toHTMLTree(text,dialect); - this.tree = transformNodes(markdownTree.slice(1)); + markdownTree = markdown.toHTMLTree(text,dialect), + node = $tw.utils.isArray(markdownTree[1]) ? markdownTree.slice(1) : markdownTree.slice(2); + this.tree = transformNodes(node); }; /*