Skip to main content

Markdown and Chart Rendering

Companion replies are rendered as rich Markdown. Headings, lists, tables, code blocks, formulas, and diagrams can be read directly in the chat, and copied either as plain text or as Markdown.

Supported Content​

ContentBehavior
MarkdownHeadings, lists, tables, and code blocks are formatted automatically
MermaidRendered as diagrams with fullscreen preview
KaTeX / LaTeXInline and block math are typeset
.md pathsTrusted assistant replies can expose clickable local Markdown paths
ImagesImage attachments can be previewed and exported

Mermaid Diagrams​

Mermaid blocks are rendered inline. Click a diagram to open fullscreen preview, then zoom with the wheel, drag to pan, or reset the view to fit the screen.

If rendering fails, DesireCore keeps the original code block so you can ask the Companion to fix it.

Math Formulas​

DesireCore supports common LaTeX syntax:

  • Inline: $E = mc^2$
  • Block: $$\int_a^b f(x) dx$$

Long formulas scroll inside the message bubble instead of breaking the layout.

Rendering Examples​

The following examples show common Markdown elements in Companion replies:

Code blocks (with syntax highlighting and one-click copying):

```python
def hello():
print("Hello, DesireCore!")
```

Tables (automatically aligned, with horizontal scrolling on narrow screens):

| Feature | Status |
|---------|--------|
| Rendering | ✅ |
| Copying | ✅ |

Mermaid diagrams (automatically rendered as visual diagrams):

```mermaid
graph LR
A[User input] --> B[Companion processing]
B --> C[Return results]
```

Math formulas (typeset with KaTeX):

Inline: $E = mc^2$
Block: $$\int_0^1 x^2 dx = \frac{1}{3}$$

Troubleshooting Rendering​

IssueWhat HappensWhat to Do
Invalid Mermaid syntaxThe original code block is kept instead of a diagramAsk the Companion to correct the syntax and output it again
Invalid LaTeX formattingThe raw LaTeX source is displayedCheck that the $ delimiters are paired
Inconsistent table column countsSome columns may be misalignedMake sure each row has the same number of | characters
Unclosed code blockSubsequent content is treated as codeMake sure opening and closing triple backticks (```) are paired
Practical Tips
  • If a Companion's Mermaid diagram does not render, tell it: "The Mermaid syntax is invalid. Please fix it."
  • To copy diagram source, use "Copy Markdown" instead of "Copy".
  • Long formulas scroll horizontally inside the message bubble without breaking the layout.

Copying​

ActionResult
CopyPlain text for chat or regular documents
Copy MarkdownPreserves headings, lists, code blocks, tables, and diagram source