Ok, less “version 2” and more like “version 0.7” but still, I can engage in a bit of version-inflation if I want.
With Edits #1 and #2, below, I am considering this done. Which means version 0.7, aka Version 2, has become Version 3, aka Version 1. It’s complicated.
In last night’s post about an simple inline substitution cipher to help obscure text so that I can avoid spoilers or keep text otherwise hidden until reader action takes place to confirm their intent, I had only the most basic pieces worked out. It was past my bedtime and I was sort of speed typing both the code and the post.
This morning I worked out a few more basic features:
- I have built a very basic “Simple Inline Substitution Cipher” page to handle the creation of these materials. It is 100% free for you to use and honestly consider it all cc-0. It’s mediocre code for an extremely niche topic.
- The cipher now should be able to pass through double- and single-quotes without breaking the HTML or Javascript.
- Rather than
paragraph
tags, I am usingspan
tags. This should help with adding stuff like single- to few-word elements inline with the rest of the text and no longer requires every instance to be a full paragraph of text. - Spans are giving a “click me” type title to help generate tool tips where supported.
- Spans are given a class of “
gentleSubCipher
” to allow for CSS to better improve their usability. - Spans are now given a random five-character ID to immensely reduce the issue of multiple IDs matching and causing potential breakage.
It looks something like this:
CsrS rS E wESrI VHEveAV SsPbr4T Pjj QsV "D8PQVS" E4z 'Sr4TAV D8PQVS' E4z QsV PQsVf 4Vb VAVvV4QS QsEQ sEyV wVV4 EzzVz.
There are still quite a few limitations:
- Just to clarify, it is not and will not be secure.
It still does not ignore HTML elements within that span.See EDIT #2, below.- It does not work with feed readers and I need to test how to make it work better with screen readers.
- Accented characters are passed through but that still is not quite a problem.
Multiple posts with it might result in a problem where version shifts break previous posts when seen the front page, category page, etc.
For the latter, the idea might be to create unique scripts per post. I’ll have to give it some thought and testing. See EDIT #1 below, this is now fixed.
The next version will be building in some logic for ignoring disabling HTML elements (Edit #2). That should be a bit trivial for the types of things I need to ignore, but we’ll have to see.
EDIT 1: I went ahead and added a “slug” function to the document so that each post will have a likely unique bit of script so that later updates should not break previous ones. That’s now built into the page. If nothing is added to the “slug” field it just outputs to the default name which can be fine for pages that will not have other versions of the script shown. It also creates a slug="SLUGNAME"
as part of the span tag just in case I ever need to go back and redo something so I have all the pieces in place.
EDIT 2: After some thought, realized that any kind of code that tries even in principle to load/render rewritten HTML is a bad thing. Rather than ignoring those elements that I might type, the script essentially just breaks them into unrendered HTML so folks can get the gist without my substitution cipher being able to inject anything, even accidentally. Tests showed that a whoopsy could lead to weird stuff happening on the page so this helps to protect it in general.
For example:
gG g bUQM KoiMbumZN Ymbu J 2mb oG <Mi>MiQuJKmK</Mi> mb mK 2MbbMS GoS iM bo dKM *JKbMSmKvK* 2MXJdKM mb XJdKMK qMKK XoZGdKmoZ. g SMJqqU Lod2b g YodqL iJvM JZUbumZN J <J uSMG="ubbQK://YYY.YUSimK.Xoi">qmZv bo iU oqL uoiMQJNM</J> 2db mG g Lo GoS KoiM SMJKoZ GoSNMb JZL bUQM bumK, mb uJK J YJU oG GJmqmZN odb oG buM mKKdM.
Leave a Reply