Browse Source

Platform: properly escape output on windowless Emscripten app.

pull/299/head
Vladimír Vondruš 8 years ago
parent
commit
4567bcfbde
  1. 1
      doc/changelog.dox
  2. 10
      src/Magnum/Platform/WindowlessEmscriptenApplication.js

1
doc/changelog.dox

@ -116,6 +116,7 @@ r<Player<T, K>>>)
- 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

10
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 { '"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;' }[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 { '"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;' }[a];
}) + '\n';
},
/* onAbort not handled here, as the output is printed directly on the page */

Loading…
Cancel
Save