コンポーネント詳細

Markdown

Render Markdown content as sanitized HTML output.

サンプル

参照情報

テンプレート
templates/components/markdown.html
ゴールデン
testdata/golden/markdown.golden.html

Go(Marionette)サンプル

この実装例は Go の Marionette を使っています。ソース: docs/site-astro/public/examples/go/markdown.go

package goexamples

import (
	mb "github.com/YoshihideShirai/marionette/backend"
	mf "github.com/YoshihideShirai/marionette/frontend"
)

func RegisterMarkdownExample(app *mb.App) {
	app.Page("/markdown", func(ctx *mb.Context) mf.Node {
		return mf.Markdown(mf.MarkdownProps{Content: "# Overview\n\n- Fast rendering\n- Safe HTML output"})
	})
}