Indentation of BASIC code with tab key

1 view
Skip to first unread message

Charlie Veniot

unread,
Jan 3, 2022, 11:19:38 AM1/3/22
to Basic Anywhere Machine NEWS
The TiddlyWiki CodeMirror plugin handles indentation with either spaces or tabs like a champ.

However, spaces and tabs are problematic for the "Wikify Viewer" tool because HTML ignores whitespace (spaces and tabs), i.e. whitespace is not rendered.  

Although both space and tab rendering can be resolved with text-replacement trickery, I've decided to setup the "Wikify Viewer" to only recognize tabs for the purpose of indentation.
(Since distinguishing spaces meant as indentation from spaces meant for other things is a pain.  Tabs can't be used for anything else in wwwBasic, so that makes things easier.)

One of the attached screenshots shows how the Wikify Viewer handles the display of transcluded code, including the handling of tab indents in that transcluded code.

The other attached screenshots show that I've gone through a few hoops to get this working.

There is some good stuff in there for TiddlyWiki learning.  More seasoned TiddlyWiki folk: please, if you have suggestions for simplifying the code, let me know.

Screenshot 2022-01-03 11.45.33 AM.png


Screenshot 2022-01-03 11.48.12 AM.png
Screenshot 2022-01-03 11.48.40 AM.png
Reply all
Reply to author
Forward
0 new messages