CodeblockContext method renames

Fixes #9577
This commit is contained in:
Bjørn Erik Pedersen
2022-02-27 13:31:55 +01:00
parent e1f696911e
commit f7109771a0
7 changed files with 14 additions and 14 deletions

View File

@@ -40,12 +40,12 @@ func TestCodeblocks(t *testing.T) {
style = 'monokai'
tabWidth = 4
-- layouts/_default/_markup/render-codeblock-goat.html --
{{ $diagram := diagrams.Goat .Code }}
{{ $diagram := diagrams.Goat .Inner }}
Goat SVG:{{ substr $diagram.SVG 0 100 | safeHTML }} }}|
Goat Attribute: {{ .Attributes.width}}|
-- layouts/_default/_markup/render-codeblock-go.html --
Go Code: {{ .Code | safeHTML }}|
Go Language: {{ .Lang }}|
Go Code: {{ .Inner | safeHTML }}|
Go Language: {{ .Type }}|
-- layouts/_default/single.html --
{{ .Content }}
-- content/p1.md --
@@ -129,7 +129,7 @@ echo "p1";
-- layouts/_default/single.html --
{{ .Content }}
-- layouts/_default/_markup/render-codeblock.html --
|{{ .Code | safeHTML }}|
|{{ .Inner | safeHTML }}|
`

View File

@@ -150,11 +150,11 @@ func (c *codeBlockContext) Page() interface{} {
return c.page
}
func (c *codeBlockContext) Lang() string {
func (c *codeBlockContext) Type() string {
return c.lang
}
func (c *codeBlockContext) Code() string {
func (c *codeBlockContext) Inner() string {
return c.code
}