J’ai ajouté cette fonctionnalité il y a quelque temps et je me suis rendu compte que je n’en avais pas parlé. Vous pouvez désormais utiliser une syntaxe spéciale en Markdown pour qu’elle soit traitée et utilisable dans les composants de thème sans avoir à écrire de plugin.
// enveloppé dans un div.d-wrap
[wrap=baz foo=bar]Contenu[/wrap]
// enveloppé dans un div.d-wrap
[wrap=baz foo=bar]
Contenu
[/wrap]
// enveloppé dans un div.d-wrap
[wrap=baz foo=bar]
[/wrap]
// celui-ci sera rendu sous forme de span.d-wrap au lieu de div.d-wrap
a [wrap=baz]Contenu[/wrap] b
Le nom du composant sera ajouté en tant qu’attribut de données : data-wrap="baz", et chaque propriété sera également un attribut de données : data-foo="bar" sur l’élément.
Si vous souhaitez consulter un cas d’utilisation réel, consultez
Thanks for suggesting this feature in the other topic.
I was excited to try to use it and see if it worked for my case, however I encountered a problem.
It seems to ignore attribute names that has multiple hyphens in between and defaults to only pick the characters after the last hyphen.
I am using v2.4.0.beta2 +33, I apologize if this has been fixed in a newer commit since.
Examples:
// No multiple hyphen this works fine: data-bloodmallet="chart".
[wrap=test bloodmallet=chart]Content[/wrap]
// This way it omits "user" from the attribute name and output is data-id="1" instead of data-user-id="1".
[wrap=test2 user-id=1]Content[/wrap]
This following request is optional: Is there a way to not wrap the content inside the div with <p> tag?
Thanks for this feature and hopefully I can use it to fix my problem!
Bonjour @j.jaffeux,
Merci pour cette fonctionnalité ! Savez-vous quelle est la meilleure approche pour ajouter une fonctionnalité pour des éléments comme :