Skip to content

Commit

Permalink
Merge pull request #36 from grafana/jdb/2024-06-fix-duplicate-directi…
Browse files Browse the repository at this point in the history
…ve-bug
  • Loading branch information
jdbaldry authored Jun 27, 2024
2 parents 79e87b2 + beb6a68 commit a50dce3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tools/transformer/goldmark/renderer/markdown/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,18 @@ func (r *Renderer) renderFencedCodeBlock(w util.BufWriter, source []byte, node a
r.write(w, "```")

if r.Config.KillercodaActions {
if _, ok := n.AttributeString("data-killercoda-exec"); ok {
r.write(w, "{{exec}}")
}
var action string

if _, ok := n.AttributeString("data-killercoda-copy"); ok {
r.write(w, "{{copy}}")
action = "{{copy}}"
}

// exec takes precedence over copy.
if _, ok := n.AttributeString("data-killercoda-exec"); ok {
action = "{{exec}}"
}

r.write(w, action)
}

r.write(w, '\n')
Expand Down

0 comments on commit a50dce3

Please sign in to comment.