Skip to content

How to use the MathJax extension? #331

@nathan-hello

Description

@nathan-hello

I have the following for rendering my markdown to html

func MarkdownRender(md []byte) []byte {

        
	extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock | parser.MathJax
	p := parser.NewWithExtensions(extensions)
        
	doc := p.Parse(md)

	opts := mdhtml.RendererOptions{
		Flags:          mdhtml.CommonFlags,
		RenderNodeHook: mdCodeHighlighter,
	}
	renderer := mdhtml.NewRenderer(opts)

	return markdown.Render(doc, renderer)
}

And in a markdown file i have a simple

$X$

This get transformed into

<span class="math inline">\(X\)</span>

I don't see where I'm supposed to get these two classes. And even with those two classes, shouldn't there be a bunch more css and even some images? I'm just really confused on how to get this to render properly. Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions