Open personalizedrefrigerator opened 9 months ago
It would be great if you can create a pull request! In fact, I'm not very good at JavaScript, TypeScript, and so on. At present, I have reached the limit of what I can do to implement the existing features. For example, I have no idea how to solve the compilation failures caused by some complex package imports (such as rendering issues with Mermaid, I tried updating to the latest version but it fails during compilation).
When developing this plugin before, I also referred to Obsidian's WYSIWYG editing feature. I remember that CodeMirror 6 provides new methods to implement the functionality of inserting rendered results in the editor. Compared to some basic functionalities, migrating to the new version may require more work for features like rendering math formulas, Mermaid, and so on.
Summary
Currently, the Enhancement plugin doesn't support the beta CodeMirror 6-based markdown editor. As the CodeMirror 5 editor may be disabled by default in Joplin 3.0, it would be nice to have Enhancement working in CodeMirror 6.
Possible migration processes
There are a few different ways we could try to add CodeMirror 6 support to the Enhancement plugin:
Suggested migration process
Rather than relying on the CodeMirror 5 compatibility layer, I suggest migrating the individual plugins to CodeMirror 6. To do this, I propose:
cm5
andcm6
.mermaidRenderer
extension, the directory structure would look like this:index.ts
, load one ofcm5/index.ts
orcm6/index.ts
based on!!CodeMirror.cm6
.It might be simpler to make small changes to the CodeMirror 5 compatibility layer for some of the extensions (for example, the table formatter). For these, the above steps would be skipped.
I'm happy to create pull requests to help migrate this plugin!