Re: adding tags in JTidy

I didn't try that method, sorry.  I used the config file and it worked like a charm.

Chunbo Shao wrote:

> Hi, Gary
>
> I want to add one tag as using "defineInlineTag" method in TagTable.
>
> If I do this by adding one line of "defaultTagTable.install(new
> Dict("tagname", (short)448, 0x140010, ParserImpl.getParseBlock(), null));"
> just after "defaultTagTable = new TagTable();" inside the
> "getDefaultTagTable" method of TagTable.java, after this is done, how
> can i compile this TagTable.java to make it work for my application which
> use JTidy as "Tidy tidy = new Tidy();...tidy.parse(...);".
>
> thanks.
>
> Chunbo
>
> On Mon, 20 Aug 2001, Gary L Peskin wrote:
>
> > Michael --
> >
> > You have a few ways to go.  Since JTidy is open source, you can hack up
> > the source yourself to automatically do something with unrecognized
> > tags.  This may even be a feature request for HTML Tidy, which you can
> > check on the SourceForge site.
> >
> > Or, you can have a look at what TagTable.java does for
> >   defineInlineTag
> >   defineBlockTag
> >   defineEmptyTag
> >   definePreTag
> >
> > and create the Dict object and install it in the TagTable yourself.
> > You'll somehow need to decide what kind of tag the unrecognized tag is.
> >
> > Gary
> >
> > Michael Ryan Bannon wrote:
> > >
> > > Thanks...one more question
> > >
> > > Is there a method I can call from Tidy that takes the actual tag as the
> > > argument?
> > > Here's the situation: i'm using JTidy in my own Java app to clean a file.
> > > JTidy finds a tag it doesn't recognize and gives me an error.  So, I get the
> > > unknown tag from that error and attempt to let JTidy know that it SHOULD
> > > recognize this tag.
> > > I guess what I'm saying is, I want to make sure I find this easiest, most
> > > elegent way to handle this.
> > >
> > > thanks,
> > >
> > > ryan
> > >
> > > Gary L Peskin wrote:
> > >
> > > > Michael --
> > > >
> > > > The config file is the same config file in both HTML Tidy and JTidy.  If
> > > > you're not using the command line, you can set the config file in JTidy
> > > > with Tidy.setConfigurationFromFile(String filename).
> > > >
> > > > Gary
> > > >
> > > > Michael Ryan Bannon wrote:
> > > > >
> > > > > Hello all,
> > > > >
> > > > > i know in HTMLTidy you can set your config file to recognize unknown
> > > > > tags by specifying those tags.  Is there a similar option in JTidy?  I
> > > > > couldn't find one, but such an option would be great.
> > > > >
> > > > > thanks,
> > > > >
> > > > > ryan
> >
> >

Received on Thursday, 23 August 2001 13:06:24 UTC