{{ $content := .Content }} {{ if findRE `` `` }} {{ $content = replace $content `
` `` }} {{ $content = replace $content `
` `
` }} {{ end }} {{ if findRE ` {{ $content = replaceRE `
  • (\s*)$1 {{ $content = replaceRE `
      (\s*)
    • $1
    • ` `` $content }} {{ $content = replaceRE `` `` $content }} {{ $content = replaceRE `` `` $content }} {{ end }} {{ $headingLevels := slice "2" "3" "4" "5" }} {{ $headingContent := $content }} {{ range $level := $headingLevels }} {{ $markStart := printf `` $id }} {{ $left := index (split $snippet $markEnd) 0 }} {{ $right := substr $snippet (len $left) }} {{ $left = replace $left `">` `">` | printf `%s` }} {{ $newContent = printf `%s%s%s%s%s` $newContent $markStart $left $anchor $right }} {{ end }} {{ $headingContent = $newContent }} {{ end }} {{ end }} {{ $content = $headingContent | safeHTML }} {{ $content }}