// SPDX-License-Identifier: AGPL-3.0-or-later
package convert
import (
"bytes"
"strings"
"testing"
)
const docmostBlocks = `{"type":"doc","content":[
{"type":"paragraph","content":[{"type":"text","text":"Plan "},
{"type":"status","attrs":{"text":"In review","color":"green"}},
{"type":"text","text":" see"},{"type":"footnote","attrs":{"text":"First note"}},
{"type":"text","text":" and"},{"type":"footnote","attrs":{"text":"Second note"}}]},
{"type":"pageBreak"},
{"type":"tabs","content":[
{"type":"tab","attrs":{"title":"Mac"},"content":[{"type":"paragraph","content":[{"type":"text","text":"Cmd"}]}]},
{"type":"tab","attrs":{"title":""},"content":[{"type":"paragraph","content":[{"type":"text","text":"Ctrl"}]}]}]},
{"type":"video","attrs":{"src":"/api/v1/files/v1","name":"demo.mp4"}},
{"type":"audio","attrs":{"src":"javascript:alert(1)","name":"x"}},
{"type":"subpages"},
{"type":"syncedPage","attrs":{"page":"P1","block":"k3j9x2a1"}}]}`
func TestDocmostBlocksExport(t *testing.T) {
doc, err := Parse([]byte(docmostBlocks))
if err != nil {
t.Fatal(err)
}
h := HTML(doc, Options{})
for _, want := range []string{
`data-type="status" data-color="green"`, `>In review`,
`[1]`, `[2]`,
`
Second note ↩`,
`break-after:page`,
`Mac
`, `Tab 2
`, `Ctrl
`,
`