]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
docs/parse-support-md: pandoc2html_inline: print failing json
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 3 Dec 2018 12:03:48 +0000 (12:03 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 10 Dec 2018 15:13:07 +0000 (15:13 +0000)
If our run of pandoc to convert pieces of markup in our hand, into
html, fails, print the json that was rejected.

No change in non-error cases.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Juergen Gross <jgross@suse.com>
docs/parse-support-md

index e2d0187dd186d1da4fe3ff80d18e2910935de365..a8f216f131d9c06bd09fe82eba766f00278c8156 100755 (executable)
@@ -247,10 +247,11 @@ sub pandoc2html_inline ($) {
     my ($content) = @_;
 
     my $json_fh = IO::File::new_tmpfile or die $!;
-    print $json_fh to_json([
-                            { unMeta => { } },
-                            [{ t => 'Para', c => $content }],
-                           ]) or die $!;
+    my $j = to_json([
+                     { unMeta => { } },
+                     [{ t => 'Para', c => $content }],
+                    ]) or die $!;
+    print $json_fh $j;
     flush $json_fh or die $!;
     seek $json_fh,0,0 or die $!;
 
@@ -270,7 +271,7 @@ sub pandoc2html_inline ($) {
             open STDIN, '<&', $json_fh or die $!;
             system 'json_pp';
         };
-        die "\n $? $!";
+        die "$j \n $? $!";
     }
 
     $html =~ s{^\<p\>}{} or die "$html ?";