This adds a handlebars helper called base64Encode that uses the same encoder as the macro, which happens to use the right parameters to pair with the browser's atob function.
Possible Drawbacks
I have not included a base64Decode function because I could not think of what it would be useful for, it's fallible if given the wrong input and would be hard to handle errors in handlebars so people should do it in javascript.
Documentation Notes
base64Encode
Turns the textual form of the value into a base64-encoded string. For example:
Added a base64Encode handlebars helper to more safely embed data into stat sheets with {{base64Encode value}} and then decode in javascript with atob(document.getElementById(...).innerText).
Identify the Bug or Feature request
closes https://github.com/RPTools/maptool/issues/4924
Description of the Change
This adds a handlebars helper called
base64Encode
that uses the same encoder as the macro, which happens to use the right parameters to pair with the browser'satob
function.Possible Drawbacks
I have not included a
base64Decode
function because I could not think of what it would be useful for, it's fallible if given the wrong input and would be hard to handle errors in handlebars so people should do it in javascript.Documentation Notes
base64Encode
Turns the textual form of the value into a base64-encoded string. For example:
Release Notes
{{base64Encode value}}
and then decode in javascript withatob(document.getElementById(...).innerText)
.This change is