Markdown attributes like id class do not work for paragraph

Hi,

I am pretty new to markdown files.. may be there is a trick or something, if I try to add a class to a paragraph it is not working. On Headlines it works.

If I do this:

+++
draft = false
title = 'Datenschutzerklärung'
description = 'Datenschutzerklärung von test.com'
+++

## Cookies {class="data-class"}
Technisch notwendige Cookies: stets aktiv
Cookies, die nicht notwendig sind: nur mit Einwilligung gesetzt
Cookie-Hinweis: Hinweis zu Cookies mit Link zur Cookie-Richtlinie
Änderungen dieser Erklärung
Diese Erklärung gilt ab 08/2025 und wird bei Bedarf angepasst. Die aktuelle Fassung ist auf der Website abrufbar.

It is working. But if I try it with a paragraph it wont.

+++
draft = false
title = 'Imprint'
url = 'imprint'
description = 'Imprint and Privacy Policy'
+++

M. Test  
Contact:
[Link to contact form](https://test.com/en/contact).
{class="test-contact"}

This is a privately run website.  
My logos, photos and sketches are all private and I do not sell it.
{class="test-class"}

May be some one can hint me in the right direction. Thanks

I have found this on stackoverflow:

[markup]
  [markup.goldmark]
    [markup.goldmark.parser]
      [markup.goldmark.parser.attribute]
        block = true

It is working now, but is it safe?

Yes, that’s why we include it the documentation:
https://gohugo.io/content-management/markdown-attributes/