streams icon indicating copy to clipboard operation
streams copied to clipboard

Error when editing node after changing to markdown

Open bp1189 opened this issue 1 year ago • 1 comments

I noticed an error when changing a node to the Markdown tiddler format and then double-clicking to edit it from the parent node's tiddler.

Error is: Uncaught Reference error: EDITOR_MAPPING_PREFIX is not defined

I am using the latest version of Chrome on Windows 10 and Android 12.

Steps to reproduce:

  1. Download new empty.html from TiddlyWiki.com
  2. Install Streams and Markdown plugins
  3. Create a new tiddler
  4. Add a new node
  5. Edit the node's tiddler to be the Markdown type
  6. Double-click in the first tiddler on the new node
  7. See error

Let me know if you have any questions or if this belongs in the main TW GitHub issues instead. Thanks!

bp1189 avatar Aug 02 '22 21:08 bp1189

Hi I just faced this issue and I think I figured out where the problem is.

EDITOR_MAPPING_PREFIX is used in the file widgets/streams-edit.js but it's not initially defined. The code that uses the variable is only run when the tiddler type isn't vnd.tiddlywiki, so usually, there aren't any errors. The not defined error only kicks in when the tiddler type is changed, like to markdown.

My solution (I'm using Tiddlywiki on node, so I'm using plugin folders and I can edit the plugin code easily) was to intialize the EDITOR_MAPPING_PREFIX variable with "$:/config/EditorTypeMappings/".

rayleandro avatar Mar 01 '24 11:03 rayleandro