This commit is contained in:
samaradel
2022-07-28 13:19:08 +02:00
parent 7d5a9528e9
commit d51b7e1d3f

View File

@@ -1,14 +1,14 @@
{% set path = body | split(pat="href=") | slice(start=1) | first | split(pat=">") | first | trim_start_matches(pat='"') {% set url = body | split(pat="href=") | slice(start=1) | first | split(pat=">") | first | trim_start_matches(pat='"')
| trim_end_matches(pat='"') %} | trim_end_matches(pat='"') %}
{% if 'https' in path %} {% if 'https' in url %}
<button onclick="window.open('{{path}}', '_blank');" <button onclick="window.open('{{url}}', '_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"> 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 %} {% else %}
<button onclick="window.location={{get_url(path=path)}}" <button onclick="window.location='{{get_url(path=url)}}'"
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"> 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>