no goldmark in compile

This commit is contained in:
Alexander Wang 2023-10-02 14:57:37 -07:00
parent 50f01f3fc3
commit 9b2f68c89f
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927
3 changed files with 18 additions and 1 deletions

View file

@ -210,7 +210,9 @@ func jsParse(this js.Value, args []js.Value) interface{} {
}
}
m, err := d2parser.Parse("", strings.NewReader(dsl), nil)
m, err := d2parser.Parse("", strings.NewReader(dsl), &d2parser.ParseOptions{
UTF16Pos: true,
})
if err != nil {
return err
}

View file

@ -1,3 +1,5 @@
//go:build !wasm
package textmeasure
import (

View file

@ -0,0 +1,13 @@
//go:build wasm
package textmeasure
import "oss.terrastruct.com/d2/d2renderers/d2fonts"
func MeasureMarkdown(mdText string, ruler *Ruler, fontFamily *d2fonts.FontFamily, fontSize int) (width, height int, err error) {
return 0, 0, nil
}
func RenderMarkdown(m string) (string, error) {
return "", nil
}