Open links in a new tab using markdown
A common need when markdown is used is target the links to a new tab or window using _blank attribute.
With this plugin you can use the filter | blank
in twig and all the links detected in the text will have the _blank attribute.
Use it after the | md
filter
Questions or bug reports
We are happy to help!
Send us an email to hello@polilla.studio and we'll reply you as soon as we can.
Or you can visit GitHub Issues Page to report any issues with plugin.
The following plugins extend or depend on the plugin
Moonamick
Manage all the content of your website in a simple and powerfull way
Moonamick
Manage all the content of your website in a simple and powerfull way
Monkey Leads
An OctoberCMS plugin for capture and manage leads
Monkey Leads
An OctoberCMS plugin for capture and manage leads
Installation
Just install PolillaStudio.Blank plugin and you can use the twig filter | blank in your template
How to use it
From this
{{ sheet.description |md }}
<p>Este es un texto con un enlace: <a href="https://example.com">Enlace 1</a></p> <p>Un enlace con segmento: <a href="https://example.com/pagina">Enlace 2</a></p> <p>Un tercer enlace con parámetros: <a href="https://example.com/another-page?var=1&var=2">Enlace 3</a></p>
Just add |blank
filter after the |md
filter
{{ sheet.description |md |blank }}
This will attach the attribute _blank to all the links founded in the text
<p>Este es un texto con un enlace: <a href="https://example.com" target="_blank">Enlace 1</a></p> <p>Un enlace con segmento: <a href="https://example.com/pagina" target="_blank">Enlace 2</a></p> <p>Un tercer enlace con parámetros: <a href="https://example.com/another-page?var=1&var=2" target="_blank">Enlace 3</a></p>
Questions or bug reports
We are happy to help!
Send us an email to hello@polilla.studio and we'll reply you as soon as we can.
Or you can visit GitHub Issues Page to report any issues with plugin.
-
This plugin has not been reviewed yet.
-
1.0.2 |
added json_decode and md_line filter Jul 15, 2024 |
---|---|
1.0.1 |
Tagged version. Fix installation problems Jan 22, 2024 |
1.0.0 |
First version of Blank Aug 05, 2023 |