From c271b19625f24e4c658b32c4b82a0f482f401b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86ndrew=20Rininsland?= Date: Wed, 26 Feb 2014 23:00:16 +0000 Subject: [PATCH] Adding condition for the Drupal Markdown text filter. --- jekyll_export/jekyll_export.module | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jekyll_export/jekyll_export.module b/jekyll_export/jekyll_export.module index aacd62d..6bfeb53 100644 --- a/jekyll_export/jekyll_export.module +++ b/jekyll_export/jekyll_export.module @@ -150,8 +150,15 @@ function jekyll_export_do_export($types, $layout) // Build the filename $filename = date('Y-m-d', $node->created) . '-' . $alias . '.md'; - // Now get the markdown - $markdown = $md->parseString($body); + // Is this already in Markdown? + if (array_key_exists('filter_markdown', filter_list_format($node->format))) { + // If so, get the markdown + $markdown = $md->parseString($body); + } else { + // Otherwise use the Markdown ad-verbatim + $markdown = $body; + } + // Generate the YAML $yaml = sprintf("---\nlayout: %s\ntitle: \"%s\"\ndate: %s\n---\n\n", $layout, $node->title, date('Y-m-d H:i:s', $node->created));