Comment 8 for bug 229931

Revision history for this message
Cong Do (codo) wrote :

I can't believe that i have to edit the library and it's my first day working with zope.
I mean at least give some option to turn off the whitespace and newline.

The impact of this bugs effect every page that use css display:inline and display:inline-block. Since the newline with display on the browser as a space.

Here is a hack for anyone having issue and zope are unwilling to help.
Quick work around is to edit program.py
change
            self._whitespace = "" + "" * len(self._last.rsplit('\n', 1)[-1])
to
            self._whitespace = ""

To add a tal command to prevent the white space in program.py
find
        # Remember whitespace for item repetition
        if self._last is not None:
            self._whitespace = "\n" + " " * len(self._last.rsplit('\n', 1)[-1])

and replace with
        try:
            whitespace = ns[TAL,'whitespace'].lower() != "false"
        except KeyError:
            whitespace = True

        # Remember whitespace for item repetition
        if self._last is not None and whitespace:
            self._whitespace = "\n" + " " * len(self._last.rsplit('\n', 1)[-1])
        else:
            self._whitespace = ""

and modified WHITELIST in tal.py to include "whitespace"