From 4376ecfb288b6089540cb359c409dac6e80562f1 Mon Sep 17 00:00:00 2001 From: Baldur Kristinsson Date: Thu, 10 Dec 2015 00:04:42 +0000 Subject: [PATCH] Fix 'unrecognized character' error and warnings about defined(@array) --- pandoc.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandoc.pm b/pandoc.pm index 9cd224d..3b63df3 100755 --- a/pandoc.pm +++ b/pandoc.pm @@ -283,13 +283,13 @@ sub htmlize ($@) { my @perl_content = @{decode_json($json_content)}; my %header_section = %{$perl_content[0]}; my @doc_title = @{$header_section{'docTitle'}}; - my @doc_authors = (defined(@{$header_section{'docAuthors'}}) || ['']); - my $num_authors = (defined(@doc_authors) || ['']); + my @doc_authors = @{$header_section{'docAuthors'}} if ref $header_section{'docAuthors'} eq 'ARRAY'; + my $num_authors = scalar @doc_authors; my @primary_author = (); if ($num_authors gt 0) { @primary_author = @{$doc_authors[0]}; } - my @doc_date = (defined(@{$header_section{'docDate'}}) || ['']); + my @doc_date = @{$header_section{'docDate'}} if ref $header_section{'docDate'} eq 'ARRAY'; sub compile_string { # The uncompiled string is an array of hashes containing words and -- 2.39.2