Solving this problem made me laugh, and cry. It did remind me of something I heard years ago

What is the difference between hardware and software? If you play with hardware enough you will break it, if you play with software enough you might just get it to work.

I like using tiddlywiki, I’ve used it as a super todo.txt for a long time. I stumbled on an implementation for Android which in turn was based on iTW for the iPhone. The iTW tiddlywiki has been tweaked to only display one tiddler at once and the render and toolbar has been optimised for a small screen.

I got it and downloaded it and all was well it worked straight out of the box on my HTC Wildfire. I just wanted to put a few notes into it to get started, this worked fine and then I tried to edit a table, ahhhh problem.

Like a lot of Wiki markup languages tables are constructed out of the pipe symbol and then I found a problem – the stock HTC keyboard does not have a pipe symbol, you can get alternate keyboards but these seem to involve “rooting” the device – it seemed a bit of overkill to me. If I went to the symbol page of the keyboard input and pressed the 1/2 button to go the the second page of symbols there is a ¦ symbol which is not the same as a pipe |. Annoyingly there are even blank unused keys on the second page of symbols.

Anyway it did give me an opportunity to have a go at starting to modify the TiddlyWiki. This is what I did, I found the section of code in the TiddlyWiki HTML file that was responsible for formatting a table, in a blank AndTidWiki file its at line 3185 but looking for “table” soon finds it – it looks like this

//-- Standard formatters

config.formatters = [
 name: "table",
 match: "^\\|(?:[^\\n]*)\\|(?:[fhck]?)$",
 lookaheadRegExp: /^\|([^\n]*)\|([fhck]?)$/mg,
 rowTermRegExp: /(\|(?:[fhck]?)$\n?)/mg,
 cellRegExp: /(?:\|([^\n\|]*)\|)|(\|[fhck]?$\n?)/mg,
 cellTermRegExp: /((?:\x20*)\|)/mg,
 rowTypes: {"c":"caption", "h":"thead", "":"tbody", "f":"tfoot"},
 handler: function(w)
  var table = createTiddlyElement(w.output,"table",null,"twtable");

And I replaced it with this, which just modifies the regular expressions to accept either a pipe or the double vertical bar

 match: "^[\\|¦](?:[^\\n]*)[\\|¦](?:[fhck]?)$",
 lookaheadRegExp: /^[\|¦]([^\n]*)[\|¦]([fhck]?)$/mg,
 rowTermRegExp: /([\|¦](?:[fhck]?)$\n?)/mg,
 cellRegExp: /(?:[\|¦]([^\n\|¦]*)[\|¦])|([\|¦][fhck]?$\n?)/mg,
 cellTermRegExp: /((?:\x20*)[\|¦])/mg,

Basically its a very simple edit – I just made the pipe and the HTC double vertical bar work interchangeable and I could use either – pipe is easier on a PC keyboard and the ¦ the only option at the moment on the phone.