2022-09-10 16:29:57 +00:00
|
|
|
//go:build js
|
2021-07-30 03:40:47 +00:00
|
|
|
|
2021-06-13 17:22:55 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall/js"
|
|
|
|
|
|
|
|
"git.handmade.network/hmn/hmn/src/parsing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
js.Global().Set("parseMarkdown", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
2021-09-01 06:15:13 +00:00
|
|
|
return parsing.ParseMarkdown(args[0].String(), parsing.ForumPreviewMarkdown)
|
2021-06-13 17:22:55 +00:00
|
|
|
}))
|
2022-09-10 16:29:57 +00:00
|
|
|
js.Global().Set("parseMarkdownEdu", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
|
|
|
return parsing.ParseMarkdown(args[0].String(), parsing.EducationPreviewMarkdown)
|
|
|
|
}))
|
2021-06-13 17:22:55 +00:00
|
|
|
|
|
|
|
var done chan bool
|
|
|
|
<-done // block forever
|
|
|
|
}
|