Simple balanced tag and braces syntax check?

Both in my own use if tiddlywiki and my extensive support in the community forums I belive we have an opportunity to help a broad audience if we develop a simple tag and braces syntax check.

I have long sought a method to detect and or highlight all braces and unclosed tags / widgets, perhaps in a preview. Problems in mismatched opens and closes are the majority of syntax errors I see. They are fragile because they break with single character errors and a common symptom is no output.

I am not a javascript coder but I know the core contains the regular expressions to parse our tiddlywiki script so a large part of the logic is already in use. Leveraging a version of the parser in an editor preview that highlights rather than renders the parsed code such as we can see mismatches would be invaluable.

  • a full syntax hightligher would be better but lets start with the higher impact opens and closure.
  • no need to to beyond the current tiddlers code such as transclusions and pragma not in the current tiddler.

I raise it here, if not to solve it now, though that would be nice, we can put this on the roadmap.

Please help me research this and raise this in Github.

1 Like

i know there was a BalanceCheck plugin made a long time ago, maybe if that is not sufficient it could be used as a baseline? it does not do tags but it does braces and other special markup characters ([]{}()~~ // __ '' ^^ ,, @@)

also, i clicked this thread with a hope that this was describing a solution and not a question, maybe consider adding a question mark to the post title?

2 Likes