Fix button target

This commit is contained in:
samaradel
2022-04-26 14:29:30 +02:00
parent 6b03a3345b
commit d28cdd07e0

View File

@@ -1,5 +1,13 @@
{% set path = body | split(pat="href=") | slice(start=1) | first | split(pat=">") | first | trim_start_matches(pat='"')
{% set path = body | split(pat="href=") | slice(start=1) | first | split(pat=">") | first | trim_start_matches(pat='"') | trim_end_matches(pat='"') %} | trim_end_matches(pat='"') %}
<button onclick="window.open('{{path}}', '_blank');" class="leading-6 border-transparent flex flex-col border-2 w-full items-start rounded transition hover:first:text-gray-500 hover:border-stone-200 hover:bg-stone-100 p-2 text-left"> {% if 'https' in path %}
<button onclick="window.open('{{path}}', '_blank');"
class="leading-6 border-transparent flex flex-col border-2 w-full items-start rounded transition hover:first:text-gray-500 hover:border-stone-200 hover:bg-stone-100 p-2 text-left">
{{ body | trim_start_matches(pat="<p>") | safe}} {{ body | trim_start_matches(pat="<p>") | safe}}
</button> </button>
{% else %}
<button onclick="window.location='{{path}}'"
class="leading-6 border-transparent flex flex-col border-2 w-full items-start rounded transition hover:first:text-gray-500 hover:border-stone-200 hover:bg-stone-100 p-2 text-left">
{{ body | trim_start_matches(pat="<p>") | safe}}
</button>
{% endif %}