Repository navigation
fix(freemind): load FreeMind files again and import them more completely - #407
Merged
Merged
Conversation
The FreeMind plugin still read xml2json from a global FilesMindMap.Util that no longer exists since the frontend was split into modules, so every .mm file failed with "FilesMindMap is not defined". Import util as the XMind plugin does. The test defined that global itself, which hid the problem; it now runs against the real module. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
FreeMind keeps formatted node text as HTML in a richcontent element instead of the TEXT attribute, so such nodes, often the central one, were shown empty. Take their text from the rich content, one line per paragraph. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 task done
FreeMind separates lines of formatted text with <br> within one paragraph, which came out as one run-on line. Take <br> as a line break, and still collapse the whitespace the HTML is wrapped with. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
FreeMind 0.8 kept formatted node text as HTML in the TEXT attribute, so the editor showed the raw markup. Take the plain text from that HTML as for rich content, and show form fields by their chosen value instead of all their options. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Take node notes from their rich content into the editor's notes, and open branches folded in FreeMind collapsed. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A .mm file that is no FreeMind map, such as a saved web page, failed with a TypeError about reading TEXT of undefined. Check for a map with a root node and fail with a clear message, and pass the message of a decoding error to the load failure instead of the error object. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The editor only has markers for priorities, so FreeMind's other icons were dropped and icon-only nodes came out empty. Show them as emoji before the node text, and map full-9 to priority 9 as well. Write the line break marker as an escape rather than an invisible character. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Nodes whose formatted text is just an image came out empty. Use the image's alternative text or file name as their text, and link images on the web from the node unless it has a link already. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Map a node's bold, italic, size and font name, its text colour and its background to the editor's node styles. FreeMind's default font is left to the editor, and a node with a background but no text colour gets FreeMind's black text, as the editor's own may not suit the background. Branch line colours and styles have no counterpart and stay unmapped. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 task done
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FreeMind (
.mm) files did not open: the editor showed "Load file fail!ReferenceError: FilesMindMap is not defined", although the app lists FreeMind as supported (read-only). Testing with real files then showed more gaps in the import. One commit each:src/plugins/freemind.jsstill calledxml2jsonthrough a globalFilesMindMap.Util. That global no longer exists since the frontend was split into modules in November 2024 (62f4fe1), so every.mmfile failed in every release since. The plugin now importsutilas the XMind plugin does. The unit test defined that global itself, which hid the problem; it now tests the real module.<richcontent TYPE="NODE">instead of theTEXTattribute. Such nodes, often the central one, were empty; their text is now taken from the HTML, one line per paragraph.<br>in that HTML is now a line break, while the whitespace the HTML is wrapped with is still collapsed.TEXT, which showed up as raw markup. It is now converted the same way. Form fields in it, such as rating dropdowns, show their chosen value.<richcontent TYPE="NOTE">) now become editor notes, and branches folded in FreeMind (FOLDED="true") open collapsed.full-9now maps to priority 9 likefull-1tofull-8.alttext or file name as its text (binah.gif→ "binah"), and an image on the web becomes the node's link unless it has one already. Images themselves can't be shown: external ones are blocked by the CSP.<font>), its text colour (COLOR) and its background (BACKGROUND_COLOR) are taken over. FreeMind's default font (SansSerif,Dialog) is left to the editor, Java's other logical fonts map to CSS families, and a node with a background but no text colour gets FreeMind's black text. Branch line colours and styles (<edge>) have no counterpart and stay unmapped..mmfile without a FreeMind map, such as a saved web page, failed with aTypeErrorabout readingTEXTofundefined. It now fails with "This file is not a valid FreeMind mind map.". Decoding errors reach the alert as their message instead of the error object.Tested on Nextcloud 32, 35 and 36, in Chromium and Firefox, with the same results on every version and in both browsers:
.mmThe counts match the files. After the icon and image commits, no node is empty except two with
TEXT=""in the Freeplane file. In Windows Chrome the emoji render in colour, for example "✅ DONE" and "✅😊 Done, but improvements possible" in the template; its central node keeps its green background with black text, and the "RESULT" nodes of the 0.8 map are red, bold and italic as in FreeMind. Unit tests cover each case; Vitest and lint pass.Backport: #408.
🤖 AI (if applicable)