INNER CODE UNIT · Go

TestCollapse_DocType

JohannesKaufmann/html-to-markdown · collapse/collapse_test.go:11

func TestCollapse_DocType(t *testing.T) {
	// The DOCTYPE gets removed
	input := `<!DOCTYPE html><html><head></head><body></body></html>`

	doc, err := html.Parse(strings.NewReader(input))
	if err != nil {
		t.Error(err)
	}

	Collapse(doc, nil)

	tester.ExpectRepresentation(t, doc, "after", `
#document
├─html
│ ├─head
│ ├─body
	`)
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…