Skip to content

Commit

Permalink
Catch up with missing upstream PR quarto-dev/quarto-cli#6555
Browse files Browse the repository at this point in the history
  • Loading branch information
rajgoel committed Oct 23, 2023
1 parent f072a39 commit 36a7427
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion chalkboard/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**
** A plugin for reveal.js adding a chalkboard.
**
** Version: 2.3.2
** Version: 2.3.3
**
** License: MIT license (see LICENSE.md)
**
Expand Down Expand Up @@ -663,6 +663,15 @@ const initChalkboard = function ( Reveal ) {
} );
a.href = window.URL.createObjectURL( blob );
} catch ( error ) {
// https://stackoverflow.com/a/6234804
// escape data for proper handling of quotes and line breaks
// in case malicious user gets a chance to craft the exception message
error = String(error)
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
a.innerHTML += ' (' + error + ')';
}
a.click();
Expand Down

0 comments on commit 36a7427

Please sign in to comment.