Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/core/test/unit/tricky-site/_site.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
13 changes: 13 additions & 0 deletions packages/core/test/unit/tricky-site/auto-anchors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<frontmatter title="Auto Anchors" />

# Auto Anchor Test

<box type="info">
This tests if anchor icons are auto-added to headings by the plugin.
</box>

## Level 2 Heading
### Level 3 Heading
#### Level 4 Heading

Note: These headings should get the anchor icons if IDs are assigned automatically.
16 changes: 16 additions & 0 deletions packages/core/test/unit/tricky-site/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<frontmatter title="Tricky Cases Test Site" />

# 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)
16 changes: 16 additions & 0 deletions packages/core/test/unit/tricky-site/mermaid-flowchart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<frontmatter title="Mermaid Flowchart" />

# Mermaid Rendering Test

<box type="info">
This page demonstrates if &lt;mermaid&gt; blocks are correctly converted and rendered.
</box>

<mermaid>
flowchart TD
A[Start] --> B{Is it?}
B -->|Yes| C[OK]
C --> D[Rethink]
D --> B
B ---->|No| E[End]
</mermaid>
25 changes: 25 additions & 0 deletions packages/core/test/unit/tricky-site/plantuml-diagrams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<frontmatter title="PlantUML Diagrams" />

# PlantUML Rendering Test

<box type="info">
This page shows how PlantUML plugin handles inline and external diagrams.
</box>

## Inline Diagram
<puml width=300>
@startuml
Alice -> Bob : Hello
Bob -> Bob : Self Call
@enduml
</puml>

## Named Diagram
<puml name="alice">
@startuml
Alice -> Bob : Hello again
@enduml
</puml>

## Referenced External Diagram (simulated)
<puml src="activity.puml" />
16 changes: 16 additions & 0 deletions packages/core/test/unit/tricky-site/shorthand-syntax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<frontmatter title="Shorthand Syntax" />

# Shorthand Syntax Handling

<box type="info">
This tests if &lt;span heading&gt; is auto-converted by the plugin.
</box>

## Case 1: Valid Shorthand Inside Panel
<panel><span heading>Heading</span></panel>

## Case 2: Invalid Use (No Attribute)
<panel><span>Heading</span></panel>

## Case 3: Wrong Container
<div><span heading>Should not convert</span></div>
16 changes: 16 additions & 0 deletions packages/core/test/unit/tricky-site/tree-syntax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<frontmatter title="Tree Syntax" />

# Tree Syntax Plugin Test

<box type="info">
This tests rendering of directory-like structures using the &lt;tree&gt; component.
</box>

<tree>
C:/course/
textbook/
index.md
C:/course/
textbook/
index.md
</tree>
44 changes: 44 additions & 0 deletions packages/core/test/unit/tricky-site/tricky-table-rendering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<frontmatter title="Table Rendering" />

# Table Rendering: Tbody Variants

<box type="info">
This page tests how MarkBind renders tables with and without &lt;tbody&gt; tags.
</box>

<panel header="Correct Table (With &lt;tbody&gt;)">
<table>
<tbody>
<tr>
<td>Planning for next version</td>
</tr>
</tbody>
</table>
</panel>

<panel header="Table Without &lt;tbody&gt;">
<table>
<tr>
<td>Planning for next version</td>
</tr>
</table>
</panel>

<panel header="Full Table with Headers + Tbody">
<table>
<tbody>
<tr>
<th>Task ID</th>
<th>Task</th>
<th>Estimated Effort</th>
<th>Prerequisite Task</th>
</tr>
<tr>
<td>E</td>
<td>Planning for next version</td>
<td>1 man day</td>
<td>D</td>
</tr>
</tbody>
</table>
</panel>