1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-25 19:17:19 +00:00
TiddlyWiki5/core
Robin Munn 326ae61929
Fix encodebase64 and decodebase64 filters (#7683)
* Fix encodebase64 and decodebase64 filters

The documentation for encodebase64 says that the input is treated as
binary data, but in fact the input is being treated as text data, with
an extra UTF-8 encoding step being performed first.

Likewise, the decodebase64 documentation says that it outputs binary
data, but in fact it will do a UTF-8 decoding step before producing
output, which will in fact garble binary data.

This commit changes the behavior of encodebase64 and decodebase64 to
match what the documentation says they do. It also adds an optional
`text` suffix to both filters to keep the current behavior.

Finally, an optional `urlsafe` suffix is added to both filters to allow
them to use the "URL-safe" variant of base64 (using `-` instead of `+`
and `_` instead of `/`).

* Try to fix failing test

Turns out a little more than this is going to be needed.

* Fix binary base64 encoding, including unit tests

* Update base64 filter documentation

* Can't use replaceAll, too new

Have to use String.replace with a global regex instead

* Replace uses of window.btoa() in rest of code

Since window.btoa() is not available under Node.js, we'll replace all
uses of it with the $tw.utils.base64encode() function that now works
correctly for binary data.

* Add link to UTF-8 glossary definition at MDN
2023-10-18 16:08:56 +01:00
..
images Fix whitespace within new journal button image 2023-07-17 09:33:38 +01:00
language Improve file type names (TID, SVG, ICO) in hints (#7764) 2023-10-03 21:37:49 +01:00
modules Fix encodebase64 and decodebase64 filters (#7683) 2023-10-18 16:08:56 +01:00
palettes Add tm-http-request message for making HTTP requests (#7422) 2023-06-13 10:35:55 +01:00
templates Revert "Bidirectional text improvements (#4541)" 2023-06-21 17:13:33 +01:00
ui Use display: grid for editor toolbar, editor and preview (#7787) 2023-10-17 11:54:20 +01:00
wiki Fix missing closing tag in tag-pill-inner macro 2023-08-25 14:06:17 +01:00
acknowledgements.tid Update Jasmine website (#7533) 2023-06-11 10:36:02 +01:00
copyright.tid It's 2023 2023-01-02 15:47:24 +00:00
icon.tid Parameterise core icons (#7413) 2023-05-06 12:08:46 +01:00
plugin.info Minor tweaks to plugin library listings 2020-04-06 10:15:18 +01:00
readme.tid Add/update plugin readmes 2014-08-07 15:49:52 +01:00
sjcl-license.tid Move SJCL license file into core plugin 2017-04-23 09:53:18 +01:00

title: $:/core/readme

This plugin contains TiddlyWiki's core components, comprising:

* JavaScript code modules
* Icons
* Templates needed to create TiddlyWiki's user interface
* British English (''en-GB'') translations of the localisable strings used by the core