aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/man_spec.lua
diff options
context:
space:
mode:
authorLennard Hofmann <lennard.hofmann@web.de>2024-06-07 21:43:17 +0200
committerGitHub <noreply@github.com>2024-06-07 12:43:17 -0700
commitda6f68ee6966ebf434eee840b22a4f45e61d77dd (patch)
treed67c695566a18d5162426a13efa1dd40e385d5f3 /test/functional/plugin/man_spec.lua
parentf3632e14e3a75114415050ab01c2d04a06036009 (diff)
downloadrneovim-da6f68ee6966ebf434eee840b22a4f45e61d77dd.tar.gz
rneovim-da6f68ee6966ebf434eee840b22a4f45e61d77dd.tar.bz2
rneovim-da6f68ee6966ebf434eee840b22a4f45e61d77dd.zip
fix(man): filter OSC 8 hyperlink markup #29171
Problem: `man cmake` shows "8;;https://cmake.orghttps://cmake.org8;;" Solution: Remove noise so that it shows as "https://cmake.org". See also: https://en.wikipedia.org/wiki/ANSI_escape_code#OSC
Diffstat (limited to 'test/functional/plugin/man_spec.lua')
-rw-r--r--test/functional/plugin/man_spec.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/plugin/man_spec.lua b/test/functional/plugin/man_spec.lua
index 978178191c..5e4ec53f8d 100644
--- a/test/functional/plugin/man_spec.lua
+++ b/test/functional/plugin/man_spec.lua
@@ -117,6 +117,29 @@ describe(':Man', function()
]])
end)
+ it('clears OSC 8 hyperlink markup from text', function()
+ feed(
+ [[
+ ithis <C-v><ESC>]8;;http://example.com<C-v><ESC>\Link Title<C-v><ESC>]8;;<C-v><ESC>\<ESC>]]
+ )
+
+ screen:expect {
+ grid = [=[
+ this {c:^[}]8;;http://example.com{c:^[}\Link Title{c:^[}]8;;{c:^[}^\ |
+ {eob:~ }|*3
+ |
+ ]=],
+ }
+
+ exec_lua [[require'man'.init_pager()]]
+
+ screen:expect([[
+ ^this Link Title |
+ {eob:~ }|*3
+ |
+ ]])
+ end)
+
it('highlights multibyte text', function()
feed(
[[