diff --git a/pkg/transpile/puzzle.go b/pkg/transpile/puzzle.go index c02ff8f..984a295 100644 --- a/pkg/transpile/puzzle.go +++ b/pkg/transpile/puzzle.go @@ -21,6 +21,7 @@ import ( "github.com/spf13/afero" "github.com/yuin/goldmark" "github.com/yuin/goldmark/extension" + "github.com/yuin/goldmark/renderer/html" "gopkg.in/yaml.v2" ) @@ -292,6 +293,9 @@ func (fp FsPuzzle) staticPuzzle() (StaticPuzzle, []byte, error) { extension.Table, extension.DefinitionList, ), + goldmark.WithRendererOptions( + html.WithUnsafe(), + ), ) md.Convert(bodyBuf.Bytes(), body) diff --git a/pkg/transpile/puzzle_test.go b/pkg/transpile/puzzle_test.go index 4779eef..0503ae9 100644 --- a/pkg/transpile/puzzle_test.go +++ b/pkg/transpile/puzzle_test.go @@ -108,8 +108,10 @@ func TestFsPuzzle(t *testing.T) { t.Error(err) } - if _, err := NewFsPuzzlePoints(catFs, 2).Puzzle(); err != nil { + if puzzle, err := NewFsPuzzlePoints(catFs, 2).Puzzle(); err != nil { 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) diff --git a/pkg/transpile/testdata/static/2/puzzle.md b/pkg/transpile/testdata/static/2/puzzle.md index 540b816..2b71ccc 100644 --- a/pkg/transpile/testdata/static/2/puzzle.md +++ b/pkg/transpile/testdata/static/2/puzzle.md @@ -23,3 +23,4 @@ This is a moth file, woo wo! * moo * squeak +a span tag