Your message dated Sat, 18 May 2013 17:32:57 +0000 with message-id <[email protected]> and subject line Bug#685046: fixed in debiandoc-sgml 1.2.28-1 has caused the Debian Bug report #685046, regarding URLs containing '&' (ampersand) are mangled to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 685046: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685046 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: debiandoc-sgml Version: 1.2.27 Severity: important Tags: patch In the kernel-handbook source we have: Check the <url id="http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=linux&src=linux-2.6" name="current bug list"> And in the HTML output this becomes: Check the <code><a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=linux%5C%7C[amp%20]%5C%7Csrc=linux-2.6">current bug list</a></code> I'm attaching a fix. Please upload and ask for a freeze exception, as this causes real breakage in debian-kernel-handbook. Ben. -- System Information: Debian Release: wheezy/sid APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: i386 (x86_64) Foreign Architectures: amd64 Kernel: Linux 3.2.0-3-amd64 (SMP w/2 CPU cores) Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages debiandoc-sgml depends on: ii libhtml-parser-perl 3.69-2 ii libroman-perl 1.23-1 ii libtext-format-perl 0.56-1 ii perl 5.14.2-12 ii sgml-base 1.26+nmu3 ii sgml-data 2.0.8 ii sgmlspl 1.03ii-32 ii sp 1.3.4-1.2.1-47.1+b1 Versions of packages debiandoc-sgml recommends: ii ghostscript 9.05~dfsg-6 ii texinfo 4.13a.dfsg.1-10 pn texlive <none> pn texlive-latex-extra <none> Versions of packages debiandoc-sgml suggests: ii debiandoc-sgml-doc 1.1.22 pn latex-cjk-all <none> pn texlive-lang-all <none> -- no debconf information>From 9b2a5f95132b499d85eb6c17b57cf8e3a7748ac6 Mon Sep 17 00:00:00 2001 From: Ben Hutchings <[email protected]> Date: Thu, 16 Aug 2012 04:16:54 +0100 Subject: [PATCH] Fix mangling of '&' in URLs SGML entities, e.g. '&' are converted on input to SDATA sequences e.g. '\|[amp ]\|'. These need to be converted back to literal characters or entities on output, depending on the format. Currently we fail to do this because: 1. The driver normalizes URLs by squashing multiple spaces. Since the spaces are significant in matching of the SDATA sequences, they are not converted (by any back-end). Change it to trim leading and trailing space only; URLs should not normally contain any spaces anyway. 2. The HTML and XML back-ends further normalize URLs using the URL class. This results in the SDATA sequences being URL-encoded, and so they are not matched in the subsequent conversion to CDATA. Swap the order of conversion so that URL-encoding is done last. This is not theoretically correct: we should convert to literal text, then URL-encode, then HTML/XML-encode. However we know that '&' and ';' will not be URL-escaped and therefore the result should be the same. --- debian/changelog | 7 +++++++ tools/lib/Format/Driver.pm | 2 +- tools/lib/Format/HTML.pm | 10 +++++++--- tools/lib/Format/XML.pm | 10 +++++++--- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2f58e28..db764f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +debiandoc-sgml (1.2.27+nmu1) UNRELEASED; urgency=low + + * Non-maintainer upload. + * Fix handling of entities (e.g. &) in URLs. + + -- Ben Hutchings <[email protected]> Thu, 16 Aug 2012 03:55:35 +0100 + debiandoc-sgml (1.2.27) unstable; urgency=low * Rebuild with debhelper sgml-base >=1.26+nmu2. Closes: #675474 diff --git a/tools/lib/Format/Driver.pm b/tools/lib/Format/Driver.pm index 368711f..b707291 100644 --- a/tools/lib/Format/Driver.pm +++ b/tools/lib/Format/Driver.pm @@ -918,7 +918,7 @@ sub end_httppath sub start_url { ( $element, $event ) = @_; - my $id = _normalize( _a( 'ID' ) ); + my $id = _trim( _a( 'ID' ) ); my $name = _a( 'NAME' ); $name = "" if ( $name eq '\|\|' ) || ( $name eq '\|urlname\|' ) || ( $name eq $id ); diff --git a/tools/lib/Format/HTML.pm b/tools/lib/Format/HTML.pm index 590bd79..564b420 100644 --- a/tools/lib/Format/HTML.pm +++ b/tools/lib/Format/HTML.pm @@ -956,7 +956,7 @@ sub _output_httppath } sub _output_url { - my $url = URI->new( $_[0] ); + my $url = URI->new( _to_cdata( $_[0] ) ); $_[1] = $_[0] if $_[1] eq ""; output( "<code><a href=\"$url\">" ); _cdata( $_[1] ); @@ -966,7 +966,7 @@ sub _output_url ## ---------------------------------------------------------------------- ## data output subroutines ## ---------------------------------------------------------------------- -sub _cdata +sub _to_cdata { ( $_ ) = @_; @@ -976,7 +976,11 @@ sub _cdata # SDATA s/\\\|(\[\w+\s*\])\\\|/$sdata{ $1 }/g; - output( $_ ); + return $_; +} +sub _cdata +{ + output( _to_cdata( $_[0] ) ); } sub _sdata { diff --git a/tools/lib/Format/XML.pm b/tools/lib/Format/XML.pm index 5e1b807..7d852ef 100644 --- a/tools/lib/Format/XML.pm +++ b/tools/lib/Format/XML.pm @@ -769,7 +769,7 @@ sub _output_httppath } sub _output_url { - my $url = URI->new( $_[0] ); + my $url = URI->new( _to_cdata( $_[0] ) ); $_[1] = $_[0] if $_[1] eq ""; output( "<ulink url=\"$url\">" ); _cdata( $_[1] ); @@ -779,14 +779,18 @@ sub _output_url ## ---------------------------------------------------------------------- ## data output subroutines ## ---------------------------------------------------------------------- -sub _cdata +sub _to_cdata { ( $_ ) = @_; # SDATA s/\\\|(\[\w+\s*\])\\\|/$sdata{ $1 }/g; - output( $_ ); + return $_; +} +sub _cdata +{ + output( _to_cdata( $_[0] ) ); } sub _sdata {
--- End Message ---
--- Begin Message ---Source: debiandoc-sgml Source-Version: 1.2.28-1 We believe that the bug you reported is fixed in the latest version of debiandoc-sgml, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to [email protected], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Osamu Aoki <[email protected]> (supplier of updated debiandoc-sgml package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing [email protected]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Format: 1.8 Date: Sun, 19 May 2013 02:20:15 +0900 Source: debiandoc-sgml Binary: debiandoc-sgml Architecture: source all Version: 1.2.28-1 Distribution: unstable Urgency: low Maintainer: Osamu Aoki <[email protected]> Changed-By: Osamu Aoki <[email protected]> Description: debiandoc-sgml - DebianDoc SGML DTD and formatting tools Closes: 616043 685046 694856 Changes: debiandoc-sgml (1.2.28-1) unstable; urgency=low . * Jessie development cycle is ON! * Switch to 3.0(quilt) format. * Fix URLs containing '&' (ampersand) using a patch provided by Ben Hutchings, thanks. Closes: #685046 * Make <a name> anchors enclose heading text using a patch provided by Samuel Bronson. Closes: #616043 * Make debiandoc2dbkpo behave with an SGML without the localization infix using a patch provided by Felix Gatzemeier. Closes: #694856 Checksums-Sha1: 8d08b3919764fc99d6a17562fa9dc28883b9e49b 1246 debiandoc-sgml_1.2.28-1.dsc 86e9069b0055b1e12b7ca43e8769ae0b6a60e108 127871 debiandoc-sgml_1.2.28.orig.tar.gz 5b0a91fea8af7b45352e59f94f8e653fb3742768 25379 debiandoc-sgml_1.2.28-1.debian.tar.gz 5d247b2024b052a0cf4bf2f548c2e9e96c49a96f 129600 debiandoc-sgml_1.2.28-1_all.deb Checksums-Sha256: 6b410422e5958cb14c5711ccc815cf622dd04f86741af58e00a93ec3d2e11edd 1246 debiandoc-sgml_1.2.28-1.dsc 9a10f735eef5dee2325f3e1ca9e232971b335d273d7f228f5f9af7bdc157415e 127871 debiandoc-sgml_1.2.28.orig.tar.gz 91aa51789a19131b80dcfc1a9dd947445670b78b82d3a424248916c49f2324f7 25379 debiandoc-sgml_1.2.28-1.debian.tar.gz 9288399be345993654fb02f9460ea381378a3ee4193b4114c2678ec912e9c09b 129600 debiandoc-sgml_1.2.28-1_all.deb Files: f726b38dbe09bb0019ac6cf38f50e8d2 1246 text optional debiandoc-sgml_1.2.28-1.dsc ed2afef42388c705fb15186f037bae82 127871 text optional debiandoc-sgml_1.2.28.orig.tar.gz 1aecd6693ecd8324870412e4a7b5f960 25379 text optional debiandoc-sgml_1.2.28-1.debian.tar.gz 0f956000be689c106ee3bd4b5b573cc2 129600 text optional debiandoc-sgml_1.2.28-1_all.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlGXuM0ACgkQ6A/EwagGHzLwNgCfXo078/jMih/obVDhbxIsjcPL x9MAnjBw5RIl4fEUsnWYT6Oc17JCB3/D =2Gei -----END PGP SIGNATURE-----
--- End Message ---

