Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

X Report information
Id: 20864
Status: resolved
Left: 0 min
Priority: 0/0
Queue: HTML-Parser

Owner: Nobody
Requestors: SCOP <scop [...] cpan.org>
Cc:
AdminCc:

Severity: Normal
Broken in: 3.53
Fixed in: (no value)



X History Display mode: Brief headersFull headers
#   Sun Aug 06 06:28:18 2006 SCOP - Ticket created  
Subject: Whitespace issue with external id and internal subset
[text/plain 920b]
Cf. http://www.w3.org/mid/eavf10.3tg.1%40mail.christoph.schneegans.de

Christoph Schneegans reported that the W3C Markup Validator fails to
find a doctype from a declaration where an internal subset immediately
(ie. no whitespace) follows an external ID:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"[]>

Indeed, the validator uses HTML::Parser for finding the doctype, but the
parser never reports the declaration event with the above. The issue
seems to be triggered by lack of whitespace between the last " and [;
with the following, the declaration event does happen as expected:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" []>

Per the XML recommendation, whitespace is not required between external
ID and internal subset, see http://www.w3.org/TR/REC-xml/#NT-doctypedecl
#   Fri Jan 12 05:55:35 2007 GAAS - Correspondence added  
[text/plain 453b]
Fixed in my sources now. To appear in HTML-Parser-3.56.
The applied patch is:

--- hparser.c 10 Jul 2006 09:00:47 -0000 2.133
+++ hparser.c 12 Jan 2007 10:53:09 -0000
@@ -1159,8 +1159,7 @@ parse_decl(PSTATE* p_state, char *beg, c
/* first word available */
PUSH_TOKEN(decl_id, s);

- while (s < end && isHSPACE(*s)) {
- s++;
+ while (1) {
while (s < end && isHSPACE(*s))
s++;


#   Fri Jan 12 05:55:36 2007 RT_System - Status changed from 'new' to 'open'  
#   Fri Jan 12 05:55:37 2007 GAAS - Status changed from 'open' to 'resolved'