www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - ddoc $(BR)

reply Carlos Santander <csantander619 gmail.com> writes:
Not exactly a bug, but it is in a sense.
DDOC generates a lot of <br>, which are ok, but the pages are rejected as not 
valid (according to the W3C validator). I'm not sure if they should be in <p> 
tags or they're just no longer accepted, but I think something should be done. 
Most of the cases can be changed by replacing the macros, but there're two
cases 
in doc.c in which $(BR) is hardcoded: lines 910 and 349. I think they should be 
changed by another macro.

-- 
Carlos Santander Bernal
May 08 2006
next sibling parent Kyle Furlong <kylefurlong gmail.com> writes:
Carlos Santander wrote:
 Not exactly a bug, but it is in a sense.
 DDOC generates a lot of <br>, which are ok, but the pages are rejected 
 as not valid (according to the W3C validator). I'm not sure if they 
 should be in <p> tags or they're just no longer accepted, but I think 
 something should be done. Most of the cases can be changed by replacing 
 the macros, but there're two cases in doc.c in which $(BR) is hardcoded: 
 lines 910 and 349. I think they should be changed by another macro.
 
Single <br> tags are not valid xml. They should all be <br/> or <br></br>. -- Kyle Furlong // Physics Undergrad, UCSB "D is going wherever the D community wants it to go." - Walter Bright
May 08 2006
prev sibling parent reply "Unknown W. Brackets" <unknown simplemachines.org> writes:
I was able to make DDoc output valid XHTML, at least a couple versions ago.

However, it's really not that possible (at least, not near-trivial) to 
make it output semantic information.  As current, most of the DDoc used 
seems to be heavily presentational, which really isn't correct for XHTML 
anyway.

What I'm trying to say is, if you want XHTML you should use XHTML.  You 
can make DDoc output code the validator will like, but it will still be 
wrong.  I suggest sticking with HTML 4 instead for DDoc output until 
which time as it is made more semantic.

But, your opinion may vary.  There is truth in the assertion that valid, 
but not semantically valid, XHTML is closer than HTML 4.  I personally 
can't write HTML anymore, just seems like C vs. D to me.... but then I 
also try to write reasonably semantic XHTML too.

-[Unknown]


 Not exactly a bug, but it is in a sense.
 DDOC generates a lot of <br>, which are ok, but the pages are rejected 
 as not valid (according to the W3C validator). I'm not sure if they 
 should be in <p> tags or they're just no longer accepted, but I think 
 something should be done. Most of the cases can be changed by replacing 
 the macros, but there're two cases in doc.c in which $(BR) is hardcoded: 
 lines 910 and 349. I think they should be changed by another macro.
 
May 09 2006
parent reply Carlos Santander <csantander619 gmail.com> writes:
Unknown W. Brackets escribió:
 I was able to make DDoc output valid XHTML, at least a couple versions ago.
 
 However, it's really not that possible (at least, not near-trivial) to 
 make it output semantic information.  As current, most of the DDoc used 
 seems to be heavily presentational, which really isn't correct for XHTML 
 anyway.
 
 What I'm trying to say is, if you want XHTML you should use XHTML.  You 
 can make DDoc output code the validator will like, but it will still be 
 wrong.  I suggest sticking with HTML 4 instead for DDoc output until 
 which time as it is made more semantic.
 
 But, your opinion may vary.  There is truth in the assertion that valid, 
 but not semantically valid, XHTML is closer than HTML 4.  I personally 
 can't write HTML anymore, just seems like C vs. D to me.... but then I 
 also try to write reasonably semantic XHTML too.
 
 -[Unknown]
 
 
But the DDOC macro says the generated document is HTML 4.01 Strict, not XHTML, so I'm validating it as such. However, the validator complains. I'm not arguing whether the output should be XHTML or not, just that if it says it's HTML 4.01 Strict, it should conform to it. -- Carlos Santander Bernal
May 09 2006
parent reply "Unknown W. Brackets" <unknown simplemachines.org> writes:
In that case, check where they are being used.

You can't put <br> elements inside some sorts of elements, such as <ul>. 
  Many people do this, however, because browsers will do it (even though 
it is invalid.)

Sorry for making the assumption that the issue was about XHTML.  Can you 
post the error message you're getting from the validator?

Thanks,
-[Unknown]


 But the DDOC macro says the generated document is HTML 4.01 Strict, not 
 XHTML, so I'm validating it as such. However, the validator complains. 
 I'm not arguing whether the output should be XHTML or not, just that if 
 it says it's HTML 4.01 Strict, it should conform to it.
 
May 09 2006
parent reply Carlos Santander <csantander619 gmail.com> writes:
Unknown W. Brackets escribió:
 In that case, check where they are being used.
 
 You can't put <br> elements inside some sorts of elements, such as <ul>. 
  Many people do this, however, because browsers will do it (even though 
 it is invalid.)
 
 Sorry for making the assumption that the issue was about XHTML.  Can you 
 post the error message you're getting from the validator?
 
No problem. Here are selected messages: This page is not Valid HTML 4.01 Strict! Line 11 column 3: document type does not allow element "BR" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag. -- Carlos Santander Bernal
May 09 2006
parent "Unknown W. Brackets" <unknown simplemachines.org> writes:
Okay, in this case you have a <br> outside a block level element, like 
those listed.  Probably it's just inside body, in this case.

Again, this is more of a semantic issue.  Personally I think quite a few 
things would need to change to output valid content.  But I can come up 
with a patch to cleanup the HTML 4.

-[Unknown]


 Unknown W. Brackets escribió:
 In that case, check where they are being used.

 You can't put <br> elements inside some sorts of elements, such as 
 <ul>.  Many people do this, however, because browsers will do it (even 
 though it is invalid.)

 Sorry for making the assumption that the issue was about XHTML.  Can 
 you post the error message you're getting from the validator?
No problem. Here are selected messages: This page is not Valid HTML 4.01 Strict! Line 11 column 3: document type does not allow element "BR" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag.
May 09 2006