From 60fd07b46c750e0891e3474f75e26076348b66c5 Mon Sep 17 00:00:00 2001 From: Baldur Kristinsson Date: Sat, 23 Apr 2016 20:31:50 +0000 Subject: [PATCH] Fix issue with inline directives --- CHANGELOG | 5 +++++ pandoc.pm | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 9b64baa..9adcbd1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +0.4.2 (2016-04-23) +================== + +* Fix issue with inline directives (Github issue #11, reported by Kevin Holzer (hlzr)) + 0.4.1 (2016-02-14) ================== diff --git a/pandoc.pm b/pandoc.pm index fb496a0..a3b803a 100755 --- a/pandoc.pm +++ b/pandoc.pm @@ -412,6 +412,10 @@ sub htmlize ($@) { require Encode; my $content = Encode::encode_utf8($params{content}); + # Protect inline plugin placeholders from being mangled by pandoc: + $content =~ s{
} + {::INLINE::PLACEHOLDER::$1::}g; + print PANDOC_OUT $content; close PANDOC_OUT; @@ -554,6 +558,11 @@ sub htmlize ($@) { waitpid $to_html_pid, 0; $content = Encode::decode_utf8(join('', @html)); + + # Reinstate placeholders for inline plugin: + $content =~ s{::INLINE::PLACEHOLDER::(\d+)::} + {
}g; + return $content; } -- 2.39.2