Use strconv.Unqoute

This commit is contained in:
Manuel Rüger 2025-11-28 14:07:28 +01:00
parent 5a70073a01
commit a7390d8b33
2 changed files with 19 additions and 18 deletions

View File

@ -2,6 +2,7 @@ package mark_test
import ( import (
"context" "context"
"fmt"
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
@ -51,6 +52,7 @@ func TestCompileMarkdown(t *testing.T) {
} }
for _, filename := range testcases { for _, filename := range testcases {
fmt.Printf("Testing: %v\n", filename)
lib, err := stdlib.New(nil) lib, err := stdlib.New(nil)
if err != nil { if err != nil {
panic(err) panic(err)

View File

@ -2,7 +2,7 @@ package renderer
import ( import (
"fmt" "fmt"
"strings" "strconv"
parser "github.com/stefanfritsch/goldmark-admonitions" parser "github.com/stefanfritsch/goldmark-admonitions"
"github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/ast"
@ -116,8 +116,7 @@ func (r *ConfluenceMkDocsAdmonitionRenderer) renderMkDocsAdmonition(writer util.
return ast.WalkStop, err return ast.WalkStop, err
} }
title := strings.Trim(string(n.Title), "\"") title, _ := strconv.Unquote(string(n.Title))
if title != "" { if title != "" {
titleHTML := fmt.Sprintf("<p><strong>%s</strong></p>\n", title) titleHTML := fmt.Sprintf("<p><strong>%s</strong></p>\n", title)
if _, err := writer.Write([]byte(titleHTML)); err != nil { if _, err := writer.Write([]byte(titleHTML)); err != nil {