]> git.g-eek.se Git - ikiwiki-pandoc.git/commitdiff
Fix issue with inline directives
authorBaldur Kristinsson <baldur.kristinsson@gmail.com>
Sat, 23 Apr 2016 20:31:50 +0000 (20:31 +0000)
committerBaldur Kristinsson <baldur.kristinsson@gmail.com>
Sat, 23 Apr 2016 20:31:50 +0000 (20:31 +0000)
CHANGELOG
pandoc.pm

index 9b64baa59064d03cb103c63cd3a9010aa2390c70..9adcbd1a9cf278649a4e64d43cd5775330938edc 100644 (file)
--- 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)
 ==================
 
index fb496a0e24a7f52001a44c8b9316543d7be686dd..a3b803a38bbf9e137f9551dcd090fedae6c2c370 100755 (executable)
--- 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{<div class="inline" id="(\d+)"></div>}
+                 {::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+)::}
+                 {<div class="inline" id="$1"></div>}g;
+
     return $content;
 }