mirror of https://github.com/dirtbags/moth.git
Pass through raw HTML in Markdown
This commit is contained in:
parent
1c2dd4695f
commit
2e0dfb601a
|
@ -21,6 +21,7 @@ import (
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
"github.com/yuin/goldmark"
|
"github.com/yuin/goldmark"
|
||||||
"github.com/yuin/goldmark/extension"
|
"github.com/yuin/goldmark/extension"
|
||||||
|
"github.com/yuin/goldmark/renderer/html"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -292,6 +293,9 @@ func (fp FsPuzzle) staticPuzzle() (StaticPuzzle, []byte, error) {
|
||||||
extension.Table,
|
extension.Table,
|
||||||
extension.DefinitionList,
|
extension.DefinitionList,
|
||||||
),
|
),
|
||||||
|
goldmark.WithRendererOptions(
|
||||||
|
html.WithUnsafe(),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
md.Convert(bodyBuf.Bytes(), body)
|
md.Convert(bodyBuf.Bytes(), body)
|
||||||
|
|
||||||
|
|
|
@ -108,8 +108,10 @@ func TestFsPuzzle(t *testing.T) {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := NewFsPuzzlePoints(catFs, 2).Puzzle(); err != nil {
|
if puzzle, err := NewFsPuzzlePoints(catFs, 2).Puzzle(); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
|
} else if !strings.Contains(puzzle.Pre.Body, "class=\"moo\"") {
|
||||||
|
t.Error("Raw HTML didn't make it through")
|
||||||
}
|
}
|
||||||
|
|
||||||
mkpuzzleDir := NewFsPuzzlePoints(catFs, 3)
|
mkpuzzleDir := NewFsPuzzlePoints(catFs, 3)
|
||||||
|
|
|
@ -23,3 +23,4 @@ This is a moth file, woo wo!
|
||||||
* moo
|
* moo
|
||||||
* squeak
|
* squeak
|
||||||
|
|
||||||
|
<span class="moo">a span tag</span>
|
||||||
|
|
Loading…
Reference in New Issue