groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/01: Allow multiline text in .pdfinfo


From: Deri James
Subject: [groff] 01/01: Allow multiline text in .pdfinfo
Date: Tue, 25 Jan 2022 19:19:12 -0500 (EST)

deri pushed a commit to branch master
in repository groff.

commit 392f88f843c51c59f6dfe6c3bdc4731cd738ddd7
Author: Deri James <deri@chuzzlewit.myzen.co.uk>
AuthorDate: Wed Jan 26 00:17:47 2022 +0000

    Allow multiline text in .pdfinfo
    
            * src/devices/gropdf/gropdf.pl: Use either '\\\\\\\\n' or
            '\[u000a]' as line separators in the string.
---
 ChangeLog                    | 7 +++++++
 src/devices/gropdf/gropdf.pl | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 910c0d0f..f90bc512 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-01-26  Deri James  <deri@chuzzlewit.myzen.co.uk>
+
+       [gropdf]: Allow multiline text in .pdfinfo
+
+       * src/devices/gropdf/gropdf.pl: Use either '\\\\\\\\n' or
+       '\[u000a]' as line separators in the string.
+
 2022-01-24  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [man pages]: Ship compilations in UTF-8 text and PDF.
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 8c4b52a7..e3a3a28e 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -875,10 +875,11 @@ sub do_x
                my $pdfmark=$1;
                $pdfmark=~s((\d{4,6}) u)(sprintf("%.1f",$1/$desc{sizescale}))eg;
                $pdfmark=~s(\\\[u00(..)\])(chr(hex($1)))eg;
+                $pdfmark=~s/\\n/\n/g;
 
-               if ($pdfmark=~m/(.+) \/DOCINFO\s*$/)
+               if ($pdfmark=~m/(.+) \/DOCINFO\s*$/s)
                {
-                   my @xwds=split(' ',"<< $1 >>");
+                   my @xwds=split(/ /,"<< $1 >>");
                    my $docinfo=ParsePDFValue(\@xwds);
 
                    foreach my $k (sort keys %{$docinfo})



reply via email to

[Prev in Thread] Current Thread [Next in Thread]