feature/id-for-hmtl-headers #3
@ -35,9 +35,9 @@ func ConvertToHTML(md string) (string, error) {
|
|||||||
// Bluemonday-Policy anpassen, sodass id-Attribute auf h1-h6 erlaubt sind.
|
// Bluemonday-Policy anpassen, sodass id-Attribute auf h1-h6 erlaubt sind.
|
||||||
p := bluemonday.UGCPolicy()
|
p := bluemonday.UGCPolicy()
|
||||||
p.AllowAttrs("id").OnElements("h1", "h2", "h3", "h4", "h5", "h6")
|
p.AllowAttrs("id").OnElements("h1", "h2", "h3", "h4", "h5", "h6")
|
||||||
htmlOutput := p.Sanitize(buf.String())
|
html := p.Sanitize(buf.String())
|
||||||
|
|
||||||
return htmlOutput, nil
|
return html, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ConvertToPlain(md string) (string, error) {
|
func ConvertToPlain(md string) (string, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user