log_format_stack

Escapes and formats a Javascript string with a stack trace to readable HTML.

Used in the logging module to show the User-Interface errors with their stack traces.