Skip to content

Commit

Permalink
no goldmark in compile
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Dec 16, 2023
1 parent 573303c commit a1cae32
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion d2js/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions lib/textmeasure/markdown.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !wasm

package textmeasure

import (
Expand Down
13 changes: 13 additions & 0 deletions lib/textmeasure/markdown_js.go
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit a1cae32

Please sign in to comment.