diff options
author | Mario <mario@mariovavti.com> | 2024-10-12 17:05:19 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-10-12 17:05:19 +0000 |
commit | 40a9989be2366f30a37c8d451bae74a1d304319b (patch) | |
tree | 246ebe0acd3cc6a2f237add5d2d7e7ade8c6f9e2 /tests/unit/includes/BBCodeTest.php | |
parent | 05a5b644bf043aee941d17ac3fb254c99b1c64d1 (diff) | |
parent | d1648927b52b537314b470fdb9b5001ed6809c4f (diff) | |
download | volse-hubzilla-40a9989be2366f30a37c8d451bae74a1d304319b.tar.gz volse-hubzilla-40a9989be2366f30a37c8d451bae74a1d304319b.tar.bz2 volse-hubzilla-40a9989be2366f30a37c8d451bae74a1d304319b.zip |
Merge branch 'fix-cleanup-bbcode-url-regex' into 'dev'
Fix naked URLs immediately followed by a newline
See merge request hubzilla/core!2150
Diffstat (limited to 'tests/unit/includes/BBCodeTest.php')
-rw-r--r-- | tests/unit/includes/BBCodeTest.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/includes/BBCodeTest.php b/tests/unit/includes/BBCodeTest.php index c6a60f35b..136fc6e0e 100644 --- a/tests/unit/includes/BBCodeTest.php +++ b/tests/unit/includes/BBCodeTest.php @@ -143,6 +143,14 @@ class BBCodeTest extends UnitTestCase { 'example url: https://example.com', 'example url: <a href="https://example.com" target="_blank" rel="nofollow noopener">https://example.com</a>' ], + 'naked url followed by newline' => [ + "https://www.example.com\nhave a great day.", + '<a href="https://www.example.com" target="_blank" rel="nofollow noopener">https://www.example.com</a><br />have a great day.', + ], + 'inline naked url' => [ + "This is a link https://example.com/some/path more info.", + 'This is a link <a href="https://example.com/some/path" target="_blank" rel="nofollow noopener">https://example.com/some/path</a> more info.', + ], 'naked url within code block is not converted to link' => [ "[code]\nhttp://example.com\n[/code]", "<pre><code>http://example.com</code></pre>" |