From 9950b5c69e6d9e729fab1bb6f83f0e751b6aa022 Mon Sep 17 00:00:00 2001 From: Ryan Burgoyne Date: Fri, 22 Feb 2013 12:37:48 -0700 Subject: [PATCH] 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. --- pandoc.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; -- 2.39.2