Element.toPrettyString

Writes out with formatting. Be warned: formatting changes the contents. Use ONLY for eyeball debugging.

This function is not stable. Its interface and output may change without notice. The only promise I make is that it will continue to make a best- effort attempt at being useful for debugging by human eyes.

I have used it in the past for diffing html documents, but even then, it might change between versions. If it is useful, great, but beware; this use is at your own risk.

class Element
final const
string
toPrettyString
(
bool insertComments = false
,,
string indentWith = "\t"
)

Meta

History

On November 19, 2021, I changed this to final. If you were overriding it, change our override to toPrettyStringImpl instead. It now just calls toPrettyStringImpl.strip to be an entry point for a stand-alone call.

If you are calling it as part of another implementation, you might want to change that call to toPrettyStringImpl as well.

I am NOT considering this a breaking change since this function is documented to only be used for eyeball debugging anyway, which means the exact format is not specified and the override behavior can generally not be relied upon.

(And I find it extremely unlikely anyone was subclassing anyway, but if you were, email me, and we'll see what we can do. I'd like to know at least.)

I reserve the right to make future changes in the future without considering them breaking as well.