[fpc-devel] fpdoc + XML description file + indentation whitespace

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Aug 6 11:01:20 CEST 2010


What is supposed to happen with whitespace in the XML Description files.
For example. Say you edit an XML file with your favourite text editor, and
you have a long description. So you add newlines (by pressing ENTER), then
indent the text to the DESCR node for easier human reading. It seems fpdoc
inserts that indented (spacing) whitespace as actual space characters (part
of the help content) in the help content. This is seen all over the place,
but not always noticed in the final output.


automatically ignores whitespace and will place words next to each other
with a single space. So this issue is never noticed.

The web browser will ignore whitespace unless that whitespaces was inside a
PRE tag in the XML Description file. See example URL below.

IPF -> INF keeps all whitespace exactly as you typed it inside the XML
Description files. So if you do indented text, you are going to have huge
sections of spaces between some words.

Both have misaligned text due to this problem as well.

?? I have not tested this output format.

Here is an example of indentation inside a PRE tag in the XML Description
file causing misaligned output when viewed with the web browser. See the
Description section.


With INF, TXT (slightly better due to manual line wrapping implementation)
and MAN the problem is much worse because they teat the content exactly as
the user entered it. So indentation, to make human readable XML, is not
recommended. Is there some way fpdoc could help alleviate the problem, or
is it the job of the output writer to trim such spaces (though this will be
very hard to catch all cases because you will never know exactly when you
should or shouldn't trim spaces).

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-devel mailing list