feat(markdown): add treeblood extensions for enhanced markdown parsing - #146
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a math rendering (MathML) extension to the Goldmark markdown pipeline to enable formula parsing/rendering. Also introduces new markdown-related dependencies to go.mod.
- Add goldmark-treeblood MathML extension into markdown renderer setup
- Add new dependencies (goldmark-treeblood and treeblood) to go.mod
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/markdown/parse.go | Imports and registers treeblood MathML extension in the Goldmark configuration |
| go.mod | Adds goldmark-treeblood and treeblood modules as (currently marked) indirect dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| github.com/shopspring/decimal v1.4.0 // indirect | ||
| github.com/tdewolff/parse/v2 v2.8.3 // indirect | ||
| github.com/valyala/fastjson v1.6.4 // indirect | ||
| github.com/wyatt915/goldmark-treeblood v0.0.0-20250825231212-5dcbdb2f4b57 // indirect |
There was a problem hiding this comment.
The module github.com/wyatt915/goldmark-treeblood is directly imported in internal/markdown/parse.go, so it should not be marked as // indirect. Remove the comment and run go mod tidy to reflect it as a direct dependency.
| github.com/wyatt915/goldmark-treeblood v0.0.0-20250825231212-5dcbdb2f4b57 // indirect | |
| github.com/wyatt915/goldmark-treeblood v0.0.0-20250825231212-5dcbdb2f4b57 |
| @@ -122,6 +123,7 @@ var gMark = goldmark.New( | |||
| ), | |||
| highlighting.WithGuessLanguage(true), | |||
| ), | |||
There was a problem hiding this comment.
Adding a new rendering capability (MathML) changes supported markdown features; consider adding a brief comment here (or updating higher-level markdown/rendering docs) to explain why MathML is enabled and any implications (e.g., output format expectations or security considerations if user-supplied content is rendered).
| ), | |
| ), | |
| // Enable MathML rendering for mathematical expressions in markdown. | |
| // MathML output allows rich math formatting, but note: | |
| // - Output will include <math> elements, which may not be supported by all HTML consumers. | |
| // - If user-supplied content is rendered, ensure proper sanitization to prevent XSS or other security issues. | |
| // - See higher-level markdown/rendering docs for more details. |
마크다운 수식 랜더링 익스텐션 추가