Advanced Markdown Features with Goldmark
Advanced Markdown Features with Goldmark
Now that we're using Goldmark, we have access to much more advanced Markdown features!
Text Formatting
You can use all the standard formatting options:
- Bold text with
**bold**or__bold__ - Italic text with
*italic*or_italic_ - Bold and italic with
***text*** Strikethroughwith~~text~~Inline codewith backticks
Lists
Ordered Lists
- First item
- Second item
- Nested item
- Another nested item
- Third item
Unordered Lists
- Item one
- Item two
- Nested item
- Another nested item
- Item three
Task Lists
- Completed task
- Incomplete task
- Another completed task
Tables
| Feature | Status | Notes |
|---|---|---|
| Headers | ✅ | All levels supported |
| Lists | ✅ | Ordered and unordered |
| Tables | ✅ | With alignment support |
| Code | ✅ | Inline and blocks |
| Links | ✅ | Internal and external |
Blockquotes
This is a blockquote. It can contain multiple paragraphs.
Like this second paragraph.
Nested blockquotes are also possible:
This is nested inside the first blockquote.
Code Examples
Here's some syntax-highlighted code:
package main
import "fmt"
func main() {
fmt.Println("Hello from MDBlog!")
}
// JavaScript with proper highlighting
function processMarkdown(text) {
const parser = new MarkdownParser();
return parser.parse(text);
}
const result = processMarkdown('# Hello World');
console.log(result);
Links and Images
Here's a link to Parsedown documentation.
You can also use reference-style links: Parsedown GitHub.
Horizontal Rules
Goldmark](https://github.com/yuin/goldmark) documentation.
You can also use reference-style links: Goldmark GitHub.
Or with asterisks:
HTML Support
Goldmark is configured to be safe by default, but it supports standard Markdown.
Mathematical Expressions
While Goldmark doesn't natively support LaTeX math, you can always add KaTeX or MathJax via the JavaScript front matter feature:
E = mc²
Conclusion
With Goldmark, MDBlog now supports the full CommonMark specification plus GitHub Flavored Markdown extensions. This makes it much more powerful while keeping the same simple workflow!
Much better than our old custom parser, right? 😉