MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestToTextTrixFigure

Function TestToTextTrixFigure

internal/htmlutil/htmlutil_test.go:90–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestToTextTrixFigure(t *testing.T) {
91 got := ToText(`<p>Before</p><figure data-trix-attachment='{"filename":"photo.png","url":"/img.png","contentType":"image/png"}'></figure><p>After</p>`)
92 if !strings.Contains(got, "[photo.png]") {
93 t.Errorf("ToText should show filename for trix figure, got %q", got)
94 }
95 if !strings.Contains(got, "Before") || !strings.Contains(got, "After") {
96 t.Errorf("ToText should include surrounding text, got %q", got)
97 }
98}
99
100func TestExtractImageURLs(t *testing.T) {
101 h := `<p>Hello</p><img src="https://example.com/a.png"><img src="https://example.com/b.jpg">`

Callers

nothing calls this directly

Calls 1

ToTextFunction · 0.85

Tested by

no test coverage detected