1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-27 18:40:28 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers
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
..
_tw_shared Clean up after #7671 (Change favicon format from ICO to PNG) (#7774) 2023-10-06 21:39:43 +01:00
about Add a summary for each release, and include in archive listing 2023-10-08 10:29:42 +01:00
commands Add missing docs for commands command 2022-12-04 21:14:30 +00:00
community Merge branch 'tiddlywiki-com' 2023-10-17 11:38:23 +01:00
concepts Merge branch 'tiddlywiki-com' 2023-06-21 09:38:41 +01:00
customising Introduce $:/tags/Global tag 2023-05-09 15:46:54 +01:00
definitions Some new gitlab related docs changes (#7651) 2023-07-31 16:30:41 +01:00
demonstrations Fix toc indentation problem (#7627) 2023-07-22 12:41:19 +01:00
editions Change http://*.tiddlywiki.com/* to https:// 2017-11-11 11:56:20 +00:00
features Docs: created Deserializers tiddler with overview of core deserializer modules (#7564) 2023-06-27 11:43:23 +01:00
fields Overhaul the filter operator documentation: part 2 2015-01-24 21:18:44 +00:00
fileformats Update docs that mention store area 2021-07-14 13:08:19 +01:00
filters Fix encodebase64 and decodebase64 filters (#7683) 2023-10-18 16:08:56 +01:00
functions Custom widgets and filter operator names must now contain a period 2023-06-01 08:06:28 +01:00
gettingstarted Docs: "Saving with the HTML5 saver" improvements (#7109) 2022-12-17 08:22:27 +00:00
hellothere Docs: Add information about the Chinese TiddlyWiki community (#7792) 2023-10-17 11:37:57 +01:00
hiddensettings Add hidden option to make "More" sidebar tabs be horizontal (#7063) 2022-11-30 09:57:14 +00:00
howtos Improve jsonstringify and stringify operators docs (#7650) 2023-09-19 15:52:04 +01:00
images Change favicon format from ICO to PNG, fix #7665 (#7671) 2023-10-04 22:15:23 +01:00
languages Tag additions (#6233) 2021-11-18 08:58:41 +00:00
learning Update ActionListopsWidget documentation including notes on de-duplication (#7301) 2023-03-04 11:48:14 +00:00
macros Add docs on achieving unique tag macro dropdowns inside list widget (#7639) 2023-07-31 12:09:46 +01:00
marketplace Add Funding and Marketplace material, and refresh HelloThere 2022-12-04 17:58:16 +00:00
mechanisms Fix miscellaneous docs typos (#7143) 2022-12-21 10:07:14 +00:00
menubar First commit of new Menu Bar plugin 2020-02-28 14:33:15 +00:00
messages Update WidgetMessage_ tm-permalink.tid (#7721) 2023-09-06 12:27:06 +01:00
nodejs Add 'filepath' source attribute to tiddlywiki.files (#7253) 2023-05-06 11:26:40 +01:00
platforms Remove docs references to Beaker Browser now it is archived 2023-01-19 16:43:48 +00:00
plugins Make save wiki button be accessible to users without colour vision (#7232) 2023-01-28 09:51:25 +00:00
pragmas Docs: Clarify that whitespace trim is inherited by procedure and widget definitions 2023-09-21 18:11:54 +01:00
procedures Docs: Clarify that whitespace trim is inherited by procedure and widget definitions 2023-09-21 18:11:54 +01:00
readme Introduce $:/tags/Global tag 2023-05-09 15:46:54 +01:00
reference Fix tag pill colouring 2021-11-19 10:52:13 +00:00
releasenotes Add a summary for each release, and include in archive listing 2023-10-08 10:29:42 +01:00
roadmap Update RoadMap tiddler 2020-05-16 19:52:54 +01:00
saving Some new gitlab related docs changes (#7651) 2023-07-31 16:30:41 +01:00
styleguide Restructure and optimize CheckboxWidget docs (#7362) 2023-04-04 18:00:04 +01:00
system Docs: Add information about the Chinese TiddlyWiki community (#7792) 2023-10-17 11:37:57 +01:00
systemtags Update SystemTag_ $__tags_Macro.tid 2023-07-31 21:02:49 +01:00
testimonials Add Funding and Marketplace material, and refresh HelloThere 2022-12-04 17:58:16 +00:00
tiddlydesktop Update TiddlyDesktop repository URL 2022-03-31 12:05:56 +01:00
variables Refactor variable invocation docs (#7642) 2023-07-31 12:13:37 +01:00
videos Use https for YouTube 2017-11-18 19:53:52 +00:00
webserver Feat: decode url-encoded user name in authenticate request header to allow CJK username in header (#7471) 2023-05-22 12:25:51 +01:00
widgets Add support for list-template and list-empty widgets for specifying list widget templates (#7784) 2023-10-14 09:31:11 +01:00
wikitext Conditional Shortcut Syntax (#7710) 2023-10-14 09:41:21 +01:00
workingwithtw Make save wiki button be accessible to users without colour vision (#7232) 2023-01-28 09:51:25 +00:00
_TiddlyStudy_ by Kebi.tid Update community resources TiddlyResearch and Drift (#7198) 2023-01-10 22:18:32 +00:00
$__StoryList.tid Revert "Allow $:/core/ui/ControlPanel/Basics to work in the story river + some docs about utility classes (#6912)" 2022-11-15 11:41:55 +00:00
Tables in WikiText CSS Utility Classes.tid Revert "Revert "add table utility classes and some docs how to use them. fix problem with control-panel basics tab shown in story river (#7039)"" 2022-11-23 21:52:36 +00:00