Improve heuristic for cleaning urls in link descr.

This commit is contained in:
Michael F. Schönitzer 2018-06-17 15:31:57 +02:00
parent 7ad365e142
commit 4d4e88bfa2

View File

@ -1869,6 +1869,12 @@ function! s:clean_url(url)
let url = filter(url, 'v:val !=# "https\:"')
let url = filter(url, 'v:val !=# "file\:"')
let url = filter(url, 'v:val !=# "xml\:"')
let url = filter(url, 'v:val !=# "html"')
let url = filter(url, 'v:val !=# "htm"')
let url = filter(url, 'v:val !=# "php"')
" remove words consisting of only hexadecimal digits or non-word characters
let url = filter(url, 'v:val !~ "^\\A\\{4,}$"')
let url = filter(url, 'v:val !~ "^\\x\\{4,}$" || v:val !~ "\\d"')
return join(url, " ")
endfunction