New CodeMirror 6 TiddlyWiki5 plugin

Hello @Springer
Great that it works with the space-space-newline plugin!

Thanks

Hi @TW_Tones

Thanks for your kind words!

I’ll look into your reported bugs.

Thank you, Simon

1 Like

Hi @BurningTreeC, could you integrate your plugin combiner in the demo page, to make it a bit easier to transfer a bunch of plugins for testing?

Thank you @etardiff , very kind!

Hi @Yaisog … I don’t know, it’s the preview page of the “official” pull request, I don’t want to add the plugin combiner there… hmmm

You could remove it before changing the PR from draft to ready.
For the time being you could also integrate the description and overview tiddlers from the original site and set them as DefaultTiddlers. Just add a final commit to remove them again before merging.

From what I remember the main issue wasn’t that the plugin’s API changed - it’s CM6 having a completely different API from the previous version which meant it wasn’t possible to just change a few lines and be done with it. I have it in the back of my head to look into this more, I just don’t have the time at the moment :slight_smile:.

1 Like

Another breaking change is that codemirror no longer publish browser library builds. You have to build the libraries on nodejs by yourself: CodeMirror Bundling Example

Yes exactly, and that’s what I’m doing. I’m building only the needed libraries

Helloo,

Coloured KaTeX is now working with your update. Thank you.
However… :slight_smile:

image

Anything between tags (I havn’t checked other tags) gets crossed out!

Deleting either the opening or closing tag removes the strikethrough.

1 Like

Hi @Ste_W , thanks for reporting! I need to look into this nasty bug! :laughing:
Also, the <center> tag is missing from autocompletions!

1 Like

CodeMirror 6 TiddlyWiki Plugin - Recent Updates

Here’s a summary of improvements made to the CodeMirror 6 editor plugin for TiddlyWiki.

Filter Autocompletion Enhancements

Completions Now Work in Plain Text Filter Expressions

Previously, filter operator completions only worked inside confirmed filter contexts like {{{filter}}} or filter="...". Now, a new IncompleteFilterRun parser detects filter-like patterns in plain text, enabling completions as you type.

Example: Typing [list[$:/StoryList]get[ now shows filter operator completions even in regular paragraph text.

Support for Function-Style Operators

  • Dots in function names: Custom functions like [my.function[operand]] are now properly recognized

  • Multiple operands: Functions with multiple parameters like [my.func[a],[b]] or [my.func<var1>,<var2>] are now fully supported for both completions and syntax highlighting

Smarter Context-Aware Completions

  • [img and [ext completions (for image/external links) now only appear when the context is ambiguous - they no longer show up inside confirmed filter contexts where they wouldn’t be valid

  • Chained operators after [operator[operand]] now properly trigger completions

Linter Improvements

Action Variable Recognition

The linter now recognizes implicit action variables provided by TiddlyWiki widgets. Variables like actionTiddler, actionValue, modifier, etc. are no longer flagged as undefined when used within action attributes.

Supported widgets include:

  • $droppable / $dropzone: actionTiddler, actionTiddlerList, modifier

  • $checkbox / $radio / $select / $range: actionValue

  • $eventcatcher: dom-*, modifier, event-*, tv-popup-coords, etc.

  • $linkcatcher: navigateTo, event, etc.

  • $keyboard: event, modifier

Nested Pragma Parameter Inheritance

Parameters from outer pragmas are now properly inherited by nested pragmas:


\procedure outer(param1)

\procedure inner()

<!-- param1 is now recognized here -->

\end

\end

Parser Improvements

Inline Code with Double Backticks

The parser now correctly handles double-backtick inline code: ``code with `single` backtick inside``

Improved Escape Handling

Backslash escapes (\x) are now only recognized for actual wiki syntax characters, reducing false positives.

Highlight/Styled Span Improvements

The @@styled@@ syntax now properly handles CSS styles followed by classes:


@@color:red;font-weight:bold;.myclass Some styled content@@

WikiLink Placeholder Support

Links can now use $param$ placeholders in their targets:


[[Link Text|$targetParam$]]

Inline KaTeX/LaTeX Support

When KaTeX is enabled, inline math expressions $$formula$$ are now properly parsed and highlighted.

Editor Engine Improvements

Auto-Close Variable Substitution

Typing $( in a \define block now auto-completes to $()$ with the cursor positioned for variable name entry. This smart completion adapts to existing brackets.

Variable Completions in Substitution Context

When inside $(...) in a \define macro, typing triggers variable name completions.

Click-Navigate Cursor Fix

Fixed an issue where the pointer cursor could remain after Ctrl+clicking navigable links.


These updates improve both the editing experience and code quality checking. The filter completion system in particular is now much more robust, supporting the full range of TiddlyWiki’s filter syntax including custom functions with multiple operands.

3 Likes

Hi @Ste_W

the KaTeX issue is fixed now! :slight_smile:

best wishes,
Simon

1 Like

I’ve had a rather frightening incident since yesterday, only now have I managed to recover my data.

I was fed up with the constant alert popups when I typed anything, I disabled the main CM6 plugin and when I reloaded, I was greeted with this:

TW was not loading at all, all I got was the above. It’s too late to backtrack and find out the exact setting/option that might have triggered the above. I assume that having set CM6 as the default editor for every single input field (input, text area, title, tags etc), and then disabling CM6, TW Core was left looking for it but it could not.

I don’t know what I should have done differently. If I deleted CM6 and all its plugins, would it behave more gracefully? Anyway I think I’ll step back from experimenting with CM6 for now :dizzy_face:

Oh Gosh, I’m so sorry @Lamnatos !

Yes, the edit-text (the simple inputs) depend on the base CM6 editor… this cross-dependency causes this problem. The edit-text plugin is rather new and I have to look into how to sort this out.

I beg for pardon for this incident

1 Like

IMPORTANT NOTE!

There’s a fix upcoming, but for now don’t use the edit-text plugin! It depends on the editor plugin and should have fallback options to the framed engine and simple engine!

I apologize for any inconvenience caused!

1 Like

I’m not sure if you’re tracking this already, but the linter gives a warning about an unclosed html tag when you have an another tag within it closed in the same line. Here’s a simple example:

<div>
    <div>Text</div>
</div>

This produces a warning shown on the first div that it is unclosed, which is not correct. However if I put each of the inner div tags on its own line, then the warning goes away.

Thank you for all your efforts in building this! This is a great addition to TW.

Hi @jc-ose

Could you please try here: https://deploy-preview-9556--tiddlywiki-previews.netlify.app/ ?
I couldn’t produce this issue on this page (this is the latest development page)

Thank you and best wishes,
Simon

I ran a few tests and I don’t get the issue on that page either! That’s good. Looks like it was specific to the demo site.

Thank you!

1 Like

image

Look at that! Thank you!

2 Likes