Make detection of pasted URLs a little stricter
This commit is contained in:
parent
3c67e991c2
commit
e151b8e604
@ -1263,7 +1263,10 @@ class Window:
|
||||
return
|
||||
if 'quote-urls-at-prompt' in opts.paste_actions and self.at_prompt:
|
||||
prefixes = '|'.join(opts.url_prefixes)
|
||||
if re.match(f'{prefixes}:', text) is not None:
|
||||
m = re.match(f'({prefixes}):(.+)', text)
|
||||
if m is not None:
|
||||
scheme, rest = m.group(1), m.group(2)
|
||||
if rest.startswith('//') or scheme in ('mailto', 'irc'):
|
||||
import shlex
|
||||
text = shlex.quote(text)
|
||||
btext = text.encode('utf-8')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user