module

Hwaro::Content::Processors::Xml

Instance methods

minify(xml : String) : String

Simple XML minification - removes excess whitespace.

Only cross-line, whitespace-only text BETWEEN tags is removed, and only where it is formatting: inside an element whose children are all elements. In mixed content (<t>Hello <b>bold</b>\n <i>x</i></t>) that whitespace is a word separator — removing it rendered "bolditalic" — and under xml:space="preserve" it is content by declaration, so both keep it verbatim.

Source