Skip to content

Commit

Permalink
Preserve indentation for referenceLinkDefinitions
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
  • Loading branch information
jdbaldry committed Sep 9, 2024
1 parent 39093d7 commit 3abc27c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/transformer/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ func (ap *AdmonitionPreprocessor) Process(src []byte) ([]byte, error) {

for i, definition := range referenceLinkDefinitions {
replacement.Write([]byte("\n"))

for i := 0; i < observedIndentation; i++ {
replacement.Write([]byte(" "))
}
replacement.Write([]byte(definition))

if i == len(referenceLinkDefinitions)-1 {
Expand Down

0 comments on commit 3abc27c

Please sign in to comment.