From 25e5b6d22730fb146f6c5ee167fc074da97684e3 Mon Sep 17 00:00:00 2001 From: Arshin Sikka Date: Sat, 12 Jul 2025 13:15:14 +0530 Subject: [PATCH 1/3] feat(footnotes): add back-to-reference link for footnotes (#2699) --- .../src/lib/markdown-it/plugins/markdown-it-footnotes.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js b/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js index ab192a6682..8ed3fa1221 100644 --- a/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js +++ b/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js @@ -118,13 +118,8 @@ function render_footnote_anchor(tokens, idx, options, env, slf) { id += ':' + tokens[idx].meta.subId; } - // CHANGE HERE - // Below line adds backreferences, but doesn't work well with panels, so disabled for now. - // Old code: - // /* ↩ with escape code to prevent display as Apple Emoji on iOS */ - // return ' \u21a9\uFE0E'; - - return ''; + /* ↩ with escape code to prevent display as Apple Emoji on iOS */ + return ' \u21A9\uFE0E'; } From 0d779e7c7655850077f7bd590ecfa9ba6c03bb43 Mon Sep 17 00:00:00 2001 From: Arshin Sikka Date: Sat, 12 Jul 2025 13:30:05 +0530 Subject: [PATCH 2/3] test(footnotes): add manual back-link test for footnotes (#2699) --- docs/userGuide/syntax/footnotes.md | 13 +++++++++++++ packages/cli/test/functional/test_site/index.md | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/docs/userGuide/syntax/footnotes.md b/docs/userGuide/syntax/footnotes.md index f9600cea95..f6722b5132 100644 --- a/docs/userGuide/syntax/footnotes.md +++ b/docs/userGuide/syntax/footnotes.md @@ -32,6 +32,19 @@ Normal footnotes won't work when used inside the attributes of MarkBind componen For example, it won't work in the `header` attribute of [panels](../components/presentation.html#panels). +### Footnote Back-Link + +Each footnote definition now includes a back-to-reference link (“↩”) +that jumps back to the original marker. + +**Rendered HTML example:** + +```html +Here is a footnote reference,[^1] + +[^1]: This is the footnote. + +
```html diff --git a/packages/cli/test/functional/test_site/index.md b/packages/cli/test/functional/test_site/index.md index 0c3eff0c2f..6d080e499b 100644 --- a/packages/cli/test/functional/test_site/index.md +++ b/packages/cli/test/functional/test_site/index.md @@ -356,3 +356,17 @@ and **this**. {{ code elements should automatically be assigned v-pre }} {% endraw %} + +
+ +

Footnote Back-Link Test

+ +This test verifies that each footnote includes a ↩ link back to its reference. + +Here is a footnote reference,[^1] + +[^1]: This is test content for footnote back-link. + +When rendered, you should see a ↩ after the footnote, and clicking it +should scroll back up to the original marker. + From a544fb10dbd6220617c857922a1f9f1f57350b56 Mon Sep 17 00:00:00 2001 From: Arshin Sikka Date: Sun, 3 Aug 2025 18:50:33 +0530 Subject: [PATCH 3/3] feat(test-site): add tricky rendering cases for table, diagrams, plugins --- docs/userGuide/syntax/footnotes.md | 13 ------ guides | 1 + .../cli/test/functional/test_site/index.md | 14 ------ .../plugins/markdown-it-footnotes.js | 9 +++- .../core/test/unit/tricky-site/_site.json | 12 +++++ .../test/unit/tricky-site/auto-anchors.md | 13 ++++++ packages/core/test/unit/tricky-site/index.md | 16 +++++++ .../unit/tricky-site/mermaid-flowchart.md | 16 +++++++ .../unit/tricky-site/plantuml-diagrams.md | 25 +++++++++++ .../test/unit/tricky-site/shorthand-syntax.md | 16 +++++++ .../core/test/unit/tricky-site/tree-syntax.md | 16 +++++++ .../tricky-site/tricky-table-rendering.md | 44 +++++++++++++++++++ packages/vue-components/src/Announcement.vue | 0 13 files changed, 166 insertions(+), 29 deletions(-) create mode 160000 guides create mode 100644 packages/core/test/unit/tricky-site/_site.json create mode 100644 packages/core/test/unit/tricky-site/auto-anchors.md create mode 100644 packages/core/test/unit/tricky-site/index.md create mode 100644 packages/core/test/unit/tricky-site/mermaid-flowchart.md create mode 100644 packages/core/test/unit/tricky-site/plantuml-diagrams.md create mode 100644 packages/core/test/unit/tricky-site/shorthand-syntax.md create mode 100644 packages/core/test/unit/tricky-site/tree-syntax.md create mode 100644 packages/core/test/unit/tricky-site/tricky-table-rendering.md create mode 100644 packages/vue-components/src/Announcement.vue diff --git a/docs/userGuide/syntax/footnotes.md b/docs/userGuide/syntax/footnotes.md index f6722b5132..f9600cea95 100644 --- a/docs/userGuide/syntax/footnotes.md +++ b/docs/userGuide/syntax/footnotes.md @@ -32,19 +32,6 @@ Normal footnotes won't work when used inside the attributes of MarkBind componen For example, it won't work in the `header` attribute of [panels](../components/presentation.html#panels). -### Footnote Back-Link - -Each footnote definition now includes a back-to-reference link (“↩”) -that jumps back to the original marker. - -**Rendered HTML example:** - -```html -Here is a footnote reference,[^1] - -[^1]: This is the footnote. - -
```html diff --git a/guides b/guides new file mode 160000 index 0000000000..6d339ba9ab --- /dev/null +++ b/guides @@ -0,0 +1 @@ +Subproject commit 6d339ba9abc7ea4b579f4bdd302ef1858467e9e3 diff --git a/packages/cli/test/functional/test_site/index.md b/packages/cli/test/functional/test_site/index.md index 6d080e499b..0c3eff0c2f 100644 --- a/packages/cli/test/functional/test_site/index.md +++ b/packages/cli/test/functional/test_site/index.md @@ -356,17 +356,3 @@ and **this**. {{ code elements should automatically be assigned v-pre }} {% endraw %} - -
- -

Footnote Back-Link Test

- -This test verifies that each footnote includes a ↩ link back to its reference. - -Here is a footnote reference,[^1] - -[^1]: This is test content for footnote back-link. - -When rendered, you should see a ↩ after the footnote, and clicking it -should scroll back up to the original marker. - diff --git a/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js b/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js index 8ed3fa1221..ab192a6682 100644 --- a/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js +++ b/packages/core/src/lib/markdown-it/plugins/markdown-it-footnotes.js @@ -118,8 +118,13 @@ function render_footnote_anchor(tokens, idx, options, env, slf) { id += ':' + tokens[idx].meta.subId; } - /* ↩ with escape code to prevent display as Apple Emoji on iOS */ - return ' \u21A9\uFE0E'; + // CHANGE HERE + // Below line adds backreferences, but doesn't work well with panels, so disabled for now. + // Old code: + // /* ↩ with escape code to prevent display as Apple Emoji on iOS */ + // return ' \u21a9\uFE0E'; + + return ''; } diff --git a/packages/core/test/unit/tricky-site/_site.json b/packages/core/test/unit/tricky-site/_site.json new file mode 100644 index 0000000000..7336f26b17 --- /dev/null +++ b/packages/core/test/unit/tricky-site/_site.json @@ -0,0 +1,12 @@ +{ + "title": "Tricky Site", + "pages": [ + "index.md", + "tricky-table-rendering.md", + "mermaid-flowchart.md", + "plantuml-diagrams.md", + "shorthand-syntax.md", + "tree-syntax.md", + "auto-anchors.md" + ] +} \ No newline at end of file diff --git a/packages/core/test/unit/tricky-site/auto-anchors.md b/packages/core/test/unit/tricky-site/auto-anchors.md new file mode 100644 index 0000000000..e0b8c5ca32 --- /dev/null +++ b/packages/core/test/unit/tricky-site/auto-anchors.md @@ -0,0 +1,13 @@ + + +# Auto Anchor Test + + +This tests if anchor icons are auto-added to headings by the plugin. + + +## Level 2 Heading +### Level 3 Heading +#### Level 4 Heading + +Note: These headings should get the anchor icons if IDs are assigned automatically. diff --git a/packages/core/test/unit/tricky-site/index.md b/packages/core/test/unit/tricky-site/index.md new file mode 100644 index 0000000000..bb799995e4 --- /dev/null +++ b/packages/core/test/unit/tricky-site/index.md @@ -0,0 +1,16 @@ + + +# Tricky Cases Test Site + +Welcome to the test site for rendering tricky and corner cases in MarkBind. + +Use this site to quickly verify if previously buggy components are rendering as expected. + +## Pages + +- [Tricky Table Rendering](tricky-table-rendering.md) +- [Mermaid Flowchart](mermaid-flowchart.md) +- [PlantUML Diagrams](plantuml-diagrams.md) +- [Shorthand Syntax](shorthand-syntax.md) +- [Tree Syntax](tree-syntax.md) +- [Auto Anchors](auto-anchors.md) diff --git a/packages/core/test/unit/tricky-site/mermaid-flowchart.md b/packages/core/test/unit/tricky-site/mermaid-flowchart.md new file mode 100644 index 0000000000..9aea932356 --- /dev/null +++ b/packages/core/test/unit/tricky-site/mermaid-flowchart.md @@ -0,0 +1,16 @@ + + +# Mermaid Rendering Test + + +This page demonstrates if <mermaid> blocks are correctly converted and rendered. + + + +flowchart TD + A[Start] --> B{Is it?} + B -->|Yes| C[OK] + C --> D[Rethink] + D --> B + B ---->|No| E[End] + diff --git a/packages/core/test/unit/tricky-site/plantuml-diagrams.md b/packages/core/test/unit/tricky-site/plantuml-diagrams.md new file mode 100644 index 0000000000..4b2a78c9ba --- /dev/null +++ b/packages/core/test/unit/tricky-site/plantuml-diagrams.md @@ -0,0 +1,25 @@ + + +# PlantUML Rendering Test + + +This page shows how PlantUML plugin handles inline and external diagrams. + + +## Inline Diagram + +@startuml +Alice -> Bob : Hello +Bob -> Bob : Self Call +@enduml + + +## Named Diagram + +@startuml +Alice -> Bob : Hello again +@enduml + + +## Referenced External Diagram (simulated) + diff --git a/packages/core/test/unit/tricky-site/shorthand-syntax.md b/packages/core/test/unit/tricky-site/shorthand-syntax.md new file mode 100644 index 0000000000..31bf5d50f3 --- /dev/null +++ b/packages/core/test/unit/tricky-site/shorthand-syntax.md @@ -0,0 +1,16 @@ + + +# Shorthand Syntax Handling + + +This tests if <span heading> is auto-converted by the plugin. + + +## Case 1: Valid Shorthand Inside Panel +Heading + +## Case 2: Invalid Use (No Attribute) +Heading + +## Case 3: Wrong Container +
Should not convert
diff --git a/packages/core/test/unit/tricky-site/tree-syntax.md b/packages/core/test/unit/tricky-site/tree-syntax.md new file mode 100644 index 0000000000..62231ead97 --- /dev/null +++ b/packages/core/test/unit/tricky-site/tree-syntax.md @@ -0,0 +1,16 @@ + + +# Tree Syntax Plugin Test + + +This tests rendering of directory-like structures using the <tree> component. + + + +C:/course/ + textbook/ + index.md +C:/course/ + textbook/ + index.md + diff --git a/packages/core/test/unit/tricky-site/tricky-table-rendering.md b/packages/core/test/unit/tricky-site/tricky-table-rendering.md new file mode 100644 index 0000000000..5359de1cb7 --- /dev/null +++ b/packages/core/test/unit/tricky-site/tricky-table-rendering.md @@ -0,0 +1,44 @@ + + +# Table Rendering: Tbody Variants + + +This page tests how MarkBind renders tables with and without <tbody> tags. + + + + + + + + + +
Planning for next version
+
+ + + + + + +
Planning for next version
+
+ + + + + + + + + + + + + + + + + +
Task IDTaskEstimated EffortPrerequisite Task
EPlanning for next version1 man dayD
+
diff --git a/packages/vue-components/src/Announcement.vue b/packages/vue-components/src/Announcement.vue new file mode 100644 index 0000000000..e69de29bb2