[pmwiki-users] A problem with HTML validation and including subsections

Patrick R. Michaud pmichaud at pobox.com
Thu Dec 15 12:07:06 CST 2005


On Thu, Dec 15, 2005 at 06:44:29PM +0100, chr at home.se wrote:
> Hi
> 
> I've tried to validate a few pages and came across a problem. A minimal
> example of a page that doesn't validate properly is illustrated here:
> 
> 	(:include HTMLValidationWithIncludes-help1#list#listend:)
> 
> 	(:include HTMLValidationWithIncludes-help2#list#listend:)
> 
> which causes two anchors '[[#list]]' being inserted into page. As a 
> result, the double anchors makes the page become not validated.
> 
> A very crude fix would be to make (:include:) not take the first anchor 
> part, but this will probably break lots of other stuff.
> ...
> Any other ideas?  Should an anchor that is inserted more than once on a 
> page automatically be renamed to avoid this validation issue? Should a 
> warning be issued?

(:include:) could possibly strip the start/end anchors from the 
included text, but I'd be wary of going much further than that.

Alternatively (:include:) could keep track of which anchors it has
seen and strip the second and subsequent copies of those anchors.

PmWiki doesn't guarantee that anything an author does will always
produce valid HTML.  In particular, if an author writes

    [[#list]]
    [[#list]]

then PmWiki doesn't do anything to try to resolve it.  But maybe
that's the solution -- the anchor markup could keep track of which
anchors have been rendered and simply ignore any instances of an
anchor past the first one (and include can then be left as-is).

Pm




More information about the pmwiki-users mailing list