aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/includes/BBCodeTest.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2025-06-18 09:18:11 +0000
committerMario <mario@mariovavti.com>2025-06-18 09:18:11 +0000
commitd788233bd7c2b99c12bbe0c89f675334baaa29ce (patch)
tree664af94ddf1e669901270173b407c949a95713c5 /tests/unit/includes/BBCodeTest.php
parent86ebef7e08e39c383bfeb626f7998f902ea2c4ec (diff)
downloadvolse-hubzilla-d788233bd7c2b99c12bbe0c89f675334baaa29ce.tar.gz
volse-hubzilla-d788233bd7c2b99c12bbe0c89f675334baaa29ce.tar.bz2
volse-hubzilla-d788233bd7c2b99c12bbe0c89f675334baaa29ce.zip
handle naked geo URIs and add tests
Diffstat (limited to 'tests/unit/includes/BBCodeTest.php')
-rw-r--r--tests/unit/includes/BBCodeTest.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/includes/BBCodeTest.php b/tests/unit/includes/BBCodeTest.php
index 50475efea..ab6e1b811 100644
--- a/tests/unit/includes/BBCodeTest.php
+++ b/tests/unit/includes/BBCodeTest.php
@@ -156,6 +156,22 @@ class BBCodeTest extends UnitTestCase {
"[code]\nhttp://example.com\n[/code]",
"<pre><code>http://example.com</code></pre>"
],
+ 'geo uri is converted to link' => [
+ 'example url: [url]geo:37.786971,-122.399677;u=35[/url]',
+ 'example url: <a href="geo:37.786971,-122.399677;u=35" target="_blank" rel="nofollow noopener">geo:37.786971,-122.399677;u=35</a>'
+ ],
+ 'geo uri with label is converted to link' => [
+ 'example url: [url=geo:37.786971,-122.399677;u=35(Wikimedia+Foundation)]Wikimedia Foundation[/url]',
+ 'example url: <a href="geo:37.786971,-122.399677;u=35(Wikimedia+Foundation)" target="_blank" rel="nofollow noopener">Wikimedia Foundation</a>'
+ ],
+ 'naked geo uri is converted to link' => [
+ 'example url: geo:37.786971,-122.399677;u=35',
+ 'example url: <a href="geo:37.786971,-122.399677;u=35" target="_blank" rel="nofollow noopener">geo:37.786971,-122.399677;u=35</a>'
+ ],
+ 'naked geo uri with label is converted to link' => [
+ 'example url: geo:37.78918,-122.40335(Wikimedia+Foundation)',
+ 'example url: <a href="geo:37.78918,-122.40335(Wikimedia+Foundation)" target="_blank" rel="nofollow noopener">Wikimedia Foundation</a>'
+ ],
];
}