-
Notifications
You must be signed in to change notification settings - Fork 24
fix(export_to_docx): render Mermaid diagrams with <br> labels — v0.5.2 #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Export to Word Enhanced — v0.5.2 Release Notes | ||
|
|
||
| **Release Date:** 2026-07-09 | ||
| **Author:** [Fu-Jie](https://github.com/Fu-Jie) | ||
| **Version:** 0.5.2 | ||
|
|
||
| --- | ||
|
|
||
| ## What's New | ||
|
|
||
| ### 📊 Mermaid Diagrams with `<br>` Labels Now Render | ||
|
|
||
| Mermaid diagrams whose node or edge labels contain `<br>` line breaks previously exported as a blank square. | ||
|
|
||
| Mermaid 11 emits `<foreignObject>` HTML labels even when the per-diagram `flowchart.htmlLabels` is set to `false`, and an unclosed `<br>` inside that HTML makes the rendered SVG invalid XML. The plugin rasterizes each diagram by loading its SVG into an `<img>` and drawing it onto a `<canvas>` — the invalid SVG fails to load, so nothing is drawn (a correctly-sized but blank square). | ||
|
|
||
| Setting `htmlLabels: false` at the **top level** of `mermaid.initialize` (the per-diagram flag alone is ignored by Mermaid 11) suppresses `<foreignObject>` entirely: labels render as native SVG `<text>`, the SVG stays valid XML, and the diagram rasterizes correctly. | ||
|
|
||
| --- | ||
|
|
||
| ## Compatibility | ||
|
|
||
| - No dependency or requirement changes. Still **requires Open WebUI ≥ 0.10.2**. | ||
|
|
||
| --- | ||
|
|
||
| *For full commit history, see the [GitHub releases page](https://github.com/Fu-Jie/openwebui-extensions/releases).* |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Export to Word Enhanced — v0.5.2 版本发布说明 | ||
|
|
||
| **发布日期:** 2026-07-09 | ||
| **作者:** [Fu-Jie](https://github.com/Fu-Jie) | ||
| **版本:** 0.5.2 | ||
|
|
||
| --- | ||
|
|
||
| ## 最新更新 | ||
|
|
||
| ### 📊 含 `<br>` 标签的 Mermaid 图表现已正常渲染 | ||
|
|
||
| 标签(节点或连线)中包含 `<br>` 换行的 Mermaid 图表此前会导出为空白方块。 | ||
|
|
||
| Mermaid 11 即使将每图的 `flowchart.htmlLabels` 设为 `false`,仍会生成 `<foreignObject>` HTML 标签,而其中未闭合的 `<br>` 使渲染出的 SVG 成为无效 XML。插件通过将 SVG 加载到 `<img>` 再绘制到 `<canvas>` 来栅格化每个图表——无效的 SVG 无法加载,因此什么都没画出来(一个大小正确但空白的方块)。 | ||
|
|
||
| 现在在 `mermaid.initialize` 的**顶层**设置 `htmlLabels: false`(Mermaid 11 会忽略仅在每图级别设置的该项),彻底禁用 `<foreignObject>`:标签渲染为原生 SVG `<text>`,SVG 保持有效 XML,图表可正确栅格化。 | ||
|
|
||
| --- | ||
|
|
||
| ## 兼容性 | ||
|
|
||
| - 无依赖或要求变更。仍**要求 Open WebUI ≥ 0.10.2**。 | ||
|
|
||
| --- | ||
|
|
||
| *完整 commit 历史,请查看 [GitHub releases 页面](https://github.com/Fu-Jie/openwebui-extensions/releases)。* |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
根据仓库样式指南(Repository Style Guide)中的 Documentation Sync 规则,当修改插件版本时,必须同步更新以下所有文档,否则 PR 检查会失败:\n\n1.
docs/plugins/actions/export_to_docx.md(或对应的镜像 README)\n2.docs/plugins/actions/export_to_docx.zh.md(或对应的镜像 README_CN)\n3.docs/plugins/actions/index.md(版本徽章)\n4.docs/plugins/actions/index.zh.md(版本徽章)\n\n当前 PR 中未包含对这些docs/目录下文件的更新,请务必同步修改以确保 PR 检查顺利通过。References