From: Ryan Burgoyne Date: Fri, 22 Feb 2013 19:37:48 +0000 (-0700) Subject: Changed method for string compilation from JSON array. Now it handles symbols correct... X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=9950b5c69e6d9e729fab1bb6f83f0e751b6aa022;p=ikiwiki-pandoc.git Changed method for string compilation from JSON array. Now it handles symbols correctly instead of surrounding them with spaces as if they were an extra word. --- diff --git a/pandoc.pm b/pandoc.pm index ed95c11..dbf04ed 100644 --- a/pandoc.pm +++ b/pandoc.pm @@ -234,14 +234,19 @@ sub htmlize ($@) { my @doc_date = @{$header_section{'docDate'}}; sub compile_string { + # The uncompiled string is an array of hashes containing words and + # string with the word "Space". my (@uncompiled_string) = @_; - my @string_without_spaces; + my $compiled_string = ''; foreach my $word_or_space(@uncompiled_string) { if (ref($word_or_space) eq "HASH") { - push @string_without_spaces, $word_or_space->{"Str"}; + $compiled_string .= $word_or_space->{"Str"}; + } + else { + $compiled_string .= ' '; } } - return join " ", @string_without_spaces; + return $compiled_string; } my $title = compile_string @doc_title;