RE: Using tags that not existing in HTML 4.0 and keep it in code afte r parsing with JTidy

Dominic Jackson wrote:
> 
> Can anyone tell me why jtidy changes the following html ('heading' being
> a custom in-line tag) in the way it does (when converting to valid xml)-
> I guess it may well be that the html doesn't conform ?
>  
> ( is it illegal for an in-line tag to appear within a font tag ? ).
> 
> INPUT HTML:
> <font>
>     <heading>
>         <b>Some text</b>
>     </heading>
> 
>     <b>Some more text</b>
> </font>
> 
> OUTPUT XML:
> <font>
>     <heading>
>         <font><b>Some text</b></font> 
>         <b>Some more text</b>
>     </heading>
> </font>


See my next message, "Bug+Fix for user-defined inline tags and inline
propagation".

For JTidy users, here is the Java version of the two changes from my
message.  The diffs are relative to the 04aug2000r6 release.


--- jtidy-04aug2000r6\src\org\w3c\tidy\ParserImpl.java	Mon Oct 30 06:21:36 2000
+++ ParserImpl.java	Thu Dec 21 15:31:56 2000
@@ -2015,8 +2015,11 @@
                         {
                             checkstack = false;
 
-                            if (lexer.inlineDup( node) > 0)
-                                continue;
+                            if (!((element.tag.model & Dict.CM_MIXED) != 0))
+                            {
+                                if (lexer.inlineDup( node) > 0)
+                                    continue;
+                            }
                         }
 
                         mode = Lexer.MixedContent;



--- jtidy-04aug2000r6\src\org\w3c\tidy\TagTable.java	Mon Oct 30 06:21:38 2000
+++ TagTable.java	Thu Dec 21 15:31:56 2000
@@ -301,7 +301,7 @@
     public void defineInlineTag( String name )
     {
         install( new Dict( name, Dict.VERS_PROPRIETARY,
-                           (Dict.CM_INLINE|Dict.CM_NO_INDENT|Dict.CM_NEW),
+                           (Dict.CM_INLINE|Dict.CM_NO_INDENT|Dict.CM_NEW|Dict.CM_MIXED),
                            ParserImpl.getParseBlock(), null ) );
     }
 

Received on Thursday, 21 December 2000 20:42:10 UTC