You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a plain text field which uses Markdown Extra e.g. {{ copy | markdown('extra', false) }} which works fine except Markdown Extra's "Special Attributes" fail for certain formatting.
This works: [Google](http://www.google.com){attr=value}
Output: <p><a href="http://www.google.com" attr="value">Google</a></p>
As do classes and IDs like this {.class #id}.
This does NOT work: [Google](http://www.google.com){target=_blank}
Output: <p><a href="http://www.google.com">Google</a>{target=_blank}</p>
Expected behavior
According to the Dingus on the Markdown Extra site, this formatting should be valid.
@brandonkelly as I said the formatting does work using PHP Markdown Extra and that can be tested via the link. It only doesn't work in Craft's implementation.
Ah wait, I see what you're saying, I didn't spot that was a multi-markdown library. It's libraries all the way down. I assumed you were just using PHP Markdown Extra.
I can confirm that it doesn't work using cebe/markdown and in fact they say that Markdown Extra is not fully supported. Perhaps worth mentioning in the docs?
What happened?
I have a plain text field which uses Markdown Extra e.g.
{{ copy | markdown('extra', false) }}
which works fine except Markdown Extra's "Special Attributes" fail for certain formatting.This works:
[Google](http://www.google.com){attr=value}
Output:
<p><a href="http://www.google.com" attr="value">Google</a></p>
As do classes and IDs like this
{.class #id}
.This does NOT work:
[Google](http://www.google.com){target=_blank}
Output:
<p><a href="http://www.google.com">Google</a>{target=_blank}</p>
Expected behavior
According to the Dingus on the Markdown Extra site, this formatting should be valid.
Dingus output:
<p><a href="http://www.google.com" target="_blank">Google</a></p>
Presumably the _ is causing the failure.
Craft CMS version
Craft CMS 4.3.6.1
PHP version
8.1.17
The text was updated successfully, but these errors were encountered: