diff options
-rw-r--r-- | markup/goldmark/codeblocks/integration_test.go | 2 | ||||
-rw-r--r-- | tpl/diagrams/diagrams.go | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/markup/goldmark/codeblocks/integration_test.go b/markup/goldmark/codeblocks/integration_test.go index fb83e7d24..1a70b0bf0 100644 --- a/markup/goldmark/codeblocks/integration_test.go +++ b/markup/goldmark/codeblocks/integration_test.go @@ -41,7 +41,7 @@ func TestCodeblocks(t *testing.T) { tabWidth = 4 -- layouts/_default/_markup/render-codeblock-goat.html -- {{ $diagram := diagrams.Goat .Inner }} -Goat SVG:{{ substr $diagram.SVG 0 100 | safeHTML }} }}| +Goat SVG:{{ substr $diagram.Wrapped 0 100 | safeHTML }} }}| Goat Attribute: {{ .Attributes.width}}| -- layouts/_default/_markup/render-codeblock-go.html -- Go Code: {{ .Inner | safeHTML }}| diff --git a/tpl/diagrams/diagrams.go b/tpl/diagrams/diagrams.go index b0ddf5a42..60ebfb902 100644 --- a/tpl/diagrams/diagrams.go +++ b/tpl/diagrams/diagrams.go @@ -25,13 +25,13 @@ import ( ) type SVGDiagram interface { + // Wrapped returns the diagram as an SVG, including the <svg> container. + Wrapped() template.HTML + // Inner returns the inner markup of the SVG. // This allows for the <svg> container to be created manually. Inner() template.HTML - // SVG returns the diagram as an SVG, including the <svg> container. - SVG() template.HTML - // Width returns the width of the SVG. Width() int @@ -47,7 +47,7 @@ func (d goatDiagram) Inner() template.HTML { return template.HTML(d.d.Body) } -func (d goatDiagram) SVG() template.HTML { +func (d goatDiagram) Wrapped() template.HTML { return template.HTML(d.d.String()) } |