Re: How to make HTMLEditorKit/HTMLReader recognize multiple spaces?

From: Thomas Weidenfeller (nobody_at_ericsson.invalid)
Date: 03/23/04


Date: Tue, 23 Mar 2004 09:10:08 +0100

Sri Krishana wrote:
> When I read a HTML file with multiple spaces, how do I make it render
> all the spaces instead of shrinking them?

This is exactly the way HTML is defined. If you need this feature to
display your HTML properly, then your HTML is not proper :-)

I suggest you fix your HTML. You can e.g.:

* Use a table for horizontal alignment

* Replace the spaces with   (nbsp = NonBreakingSPace)

* Use the pre-element.

> I believe there must be ways
> to replace the parser

Do you really want to re-write it, because you don't want to fix your HTML?

> or DTD to make it show all the spaces.

A DTD dose not define how data is displayed, only how it is structured.

> Does
> anyone know how to go about this one?

Fix your HTML.

/Thomas


Quantcast