Skip to content

Commit eb9e8a9

Browse files
authored
Merge pull request #366 from ostrolucky/regex-links
URLify header value links
2 parents 8a29bce + 3112562 commit eb9e8a9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Resources/views/http_message.html.twig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@
1717
{% set content = content ~ "\n" ~ row %}
1818
{% else %}
1919
{% set row = row|split(':') %}
20+
{% set value = row|slice(1)|join(':')|trim %}
2021
<tr>
2122
<th>{{ row[0] }}</th>
22-
<td>{{ row|slice(1)|join(':')|trim }}</td>
23+
<td>
24+
{% if value matches '#^http(?s)://#' %}
25+
<a href="{{ value }}">{{ value }}</a>
26+
{% else %}
27+
{{ value }}
28+
{% endif %}
29+
</td>
2330
</tr>
2431
{% endif %}
2532
{% endfor %}

0 commit comments

Comments
 (0)