Skip to content

[stable-0.1] fix(freemind): load FreeMind files again and import them more completely - #408

Merged
AndyScherzinger merged 10 commits into
stable-0.1from
backport/freemind-import-stable-0.1
Oct 20, 2026
Merged

AndyScherzinger merged 10 commits into
stable-0.1from
backport/freemind-import-stable-0.1

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Backport of #407 to stable-0.1.

  • Load failure: FreeMind (.mm) files failed with "FilesMindMap is not defined". The plugin read xml2json from a global that no longer exists since the frontend was split into modules; it now imports util.
  • Formatted text: formatted node text, as HTML in <richcontent TYPE="NODE"> (FreeMind 0.9+) or directly in TEXT (FreeMind 0.8), is shown as plain text with its line breaks.
  • Notes and folded branches: notes are imported, and folded branches open collapsed.
  • Icons and images: FreeMind icons without an editor marker are shown as emoji, and image-only nodes are named after their image and link it.
  • Text style and colours: bold, italic, size, font name, text colour and background of nodes are taken over; branch lines are not.
  • Not a FreeMind file: a .mm file without a FreeMind map fails with "This file is not a valid FreeMind mind map." instead of a TypeError.

All commits cherry-picked without changes. Tested on Nextcloud 32 and 35 in Chromium and Firefox with the same files and results as #407: a FreeMind template, FreeMind's own documentation map, a Freeplane map, a FreeMind 0.8 map, and a saved web page. Vitest (104 tests) and lint pass.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

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>
(cherry picked from commit bc6586e)
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>
(cherry picked from commit 801274e)
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>
(cherry picked from commit b47d23d)
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>
(cherry picked from commit 3bf4ef1)
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>
(cherry picked from commit 093d116)
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>
(cherry picked from commit 084addd)
@AndyScherzinger AndyScherzinger changed the title [stable-0.1] fix(freemind): load FreeMind files again [stable-0.1] fix(freemind): load FreeMind files again and import them more completely Oct 20, 2026
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>
(cherry picked from commit 81ebdd7)
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>
(cherry picked from commit 3aab843)
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
(cherry picked from commit 9951458)
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>
(cherry picked from commit ca2a271)
@AndyScherzinger
AndyScherzinger merged commit ed17651 into stable-0.1 Oct 20, 2026
7 checks passed
@AndyScherzinger
AndyScherzinger deleted the backport/freemind-import-stable-0.1 branch October 20, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant