Mod_strip newline substitution problem

@Evan M.

I built Nginx 0.6.30 with the third party module mod_strip. The problem
I
am seeing is when mod_strip removes a newline “\n” it does not replace
it
with a space. Instead, the last word of one line is jammed next to the
first word of the next line. If it helps I am writing the HTML files by
hand using the editor, “vi”.

For example, The following text is on two lines and entered as:

This is a test
Allow me to explain

When mod_strip encounters the newline at “test\n” then both lines are
joined, but the words “test” and “Allow” are jammed together:

This is a testAllow me to explain

Perhaps when a newline is seen mod_strip should add a space and check
for
double spaces afterward?

BTW, everything else mod_strip touches is formated correctly and I have
had
no issues with any other facet of the program. If there is a fix I would
be
happy to test it.

Thanks for your time.

The problem is that I can’t replace newlines before end tags with a
space:

http://www.emf.net/~estephen/htmlner/whitespacebugs.html

Unfortunately mod_strip doesn’t support look-ahead. When it encounters a
newline, it has to decide what to do with it before examining subsequent
characters (that is, before examining whether the newline precedes an
end
tag).

Short of rewriting to support look-ahead, maybe I could support options:

location … {
strip on;
strip_characters tabs spaces newlines;
}

By default perhaps newlines shouldn’t be processed. What do you think?
In
any event, I will update the docs to reflect this bug.

Thanks,

Evan