From f10910dc63407ccf9122cc298bd09acbad2609e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 9 Aug 2018 22:03:07 +0200 Subject: [PATCH] popupBody: link to wikipedia --- popupBody.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/popupBody.html b/popupBody.html index c5e9e9e7..ffa09d24 100644 --- a/popupBody.html +++ b/popupBody.html @@ -115,4 +115,25 @@ {% endif %} +{% set wikipedia = null %} +{% if attribute(tags, 'wikipedia') %} + {% set wikipedia = tags.wikipedia|matches("^([^:]+):(.*)$") %} +{% endif %} + +{% if not wikipedia %} + {% for k, v in tags %} + {% set m = k|matches("^wikipedia:(.*)$") %} + {% if m %} + {% set wikipedia = [ 0, m[1], v ] %} + {% endif %} + {% endfor %} +{% endif %} + +{% if wikipedia %} +
  • + + {{ keyTrans('wikipedia') }}: + {{ wikipedia[2] }} +{% endif %} +