mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Fix #1921704 [Custom identifiers: pasting in Edit Metadata fails if http/https is wrong one](https://bugs.launchpad.net/calibre/+bug/1921704)
This commit is contained in:
parent
82f773f6b6
commit
157a26a270
@ -1678,6 +1678,8 @@ class IdentifiersEdit(QLineEdit, ToMetadataMixin):
|
|||||||
for name, template in rule:
|
for name, template in rule:
|
||||||
try:
|
try:
|
||||||
url_pattern = formatter.safe_format(template, vals, '', vals)
|
url_pattern = formatter.safe_format(template, vals, '', vals)
|
||||||
|
if url_pattern.startswith('http:') or url_pattern.startswith('https:'):
|
||||||
|
url_pattern = '(?:http|https):' + url_pattern.partition(':')[2]
|
||||||
new_id = re.compile(url_pattern)
|
new_id = re.compile(url_pattern)
|
||||||
new_id = new_id.search(text).group('new_id')
|
new_id = new_id.search(text).group('new_id')
|
||||||
if new_id:
|
if new_id:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user