Hi Josiah > My FIRST question is this: Is it possible to make a new parser for mark-up > without having to use JavaScript? Just a macro using Regular Expressions?
As Mario has explained, it’s not currently possible to create a new parse rule without using JavaScript. It is something that I often think about, though: I like the idea of TiddlyWiki users being able to evolve their own unique domain specific markup, precisely for applications like screenwriting. However, it’s hard to imagine a non-JavaScript approach to parsers that would allow us to replicate the complexity of something like the current table or list parser rules. The underlying rules seem sufficiently complex that some kind of programming language is required to express the logic, and that the language must necessarily be a good deal more complex than regular expressions themselves. Instead, I’ve wondered whether we might be able to make (some of) the existing parser rules much more configurable. For example, right now there are 6 separate parser modules for each of bold, italic, strikethrough, subscript, superscript and underscore: https://github.com/Jermolene/TiddlyWiki5/tree/master/core/modules/parsers/wikiparser/rules/emphasis <https://github.com/Jermolene/TiddlyWiki5/tree/master/core/modules/parsers/wikiparser/rules/emphasis> But, if you look at the individual JavaScript files, you’ll see that they only vary through a few parameters: the name of the rule, the regular expression to match at the start, and the regular expression to match at the end, and the tag of the HTML element to create. So, one could imagine refactoring things so that there was a single JS parse rule, and that it was instantiated multiple times with different parameters. Then, users could evolve their own notation for, say, sotto voce, and then make a new instance of the parse rule with slightly modified parameters. Best wishes Jeremy -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/2B671DBB-15AB-4CBF-86A7-733D337132E7%40gmail.com. For more options, visit https://groups.google.com/d/optout.

