diff --git a/doc/changelog.dox b/doc/changelog.dox index 8a076a063..082ed61b0 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -116,6 +116,7 @@ r>>) - Don't assert in DPI scaling detection in @ref Platform::Sdl2Application and @ref Platform::GlfwApplication on X11 DEs that don't create any `RESOURCE_MANAGER` (see [mosra/magnum#290](https://github.com/mosra/magnum/issues/290)) +- Properly escaping log output on Emscripten @ref Platform::WindowlessEglApplication - The @ref GL::Context::States enum set was missing value combining operators - Fixed @ref Text::DistanceFieldGlyphCache internal formats on ES2 devices that support @gl_extension{EXT,texture_storage} (see diff --git a/src/Magnum/Platform/WindowlessEmscriptenApplication.js b/src/Magnum/Platform/WindowlessEmscriptenApplication.js index 1484b5673..3184ebdc9 100644 --- a/src/Magnum/Platform/WindowlessEmscriptenApplication.js +++ b/src/Magnum/Platform/WindowlessEmscriptenApplication.js @@ -33,12 +33,18 @@ var Module = { printErr: function(message) { var log = document.getElementById('log'); - log.innerHTML += Array.prototype.slice.call(arguments).join(' ') + '\n'; + log.innerHTML += Array.prototype.slice.call(arguments).join(' ') + .replace(/[\"&<>]/g, function (a) { + return { '"': '"', '&': '&', '<': '<', '>': '>' }[a]; + }) + '\n'; }, print: function(message) { var log = document.getElementById('log'); - log.innerHTML += Array.prototype.slice.call(arguments).join(' ') + '\n'; + log.innerHTML += Array.prototype.slice.call(arguments).join(' ') + .replace(/[\"&<>]/g, function (a) { + return { '"': '"', '&': '&', '<': '<', '>': '>' }[a]; + }) + '\n'; }, /* onAbort not handled here, as the output is printed directly on the page */