Thread:Project:Support desk/Unexpected breaks in HTML before closing tags/reply (6)

The way you're using MediaWiki is, simply put, not supported.

Instead of parsing an ?action=render, why don't you use the API? You can retrieve the plain content of any page or revision without being parsed (no extra formatting, no extra whitespace, just what you enter in the edit area), something probably more suitable for your needs. The content is formatted according to the selected format (XML, JSON, etc) so you can't extract the contents as if it were plain text.

If you want the content without any format, use action=raw instead of action=render.