mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make URLs in check book help text clickable
This commit is contained in:
parent
850b2b8a9d
commit
86d75fcc83
@ -63,7 +63,7 @@ def message_to_error(message, name, line_offset=0):
|
||||
ans.HELP = rule.get('desc') or ''
|
||||
ans.css_rule_id = rule_id
|
||||
if ans.HELP and 'url' in rule:
|
||||
ans.HELP += ' ' + _('See {}').format(rule['url'])
|
||||
ans.HELP += ' ' + _('See <a href="{}">detailed description</a>.').format(rule['url'])
|
||||
return ans
|
||||
|
||||
|
||||
@ -237,8 +237,10 @@ def create_job(name, css, line_offset=0, is_declaration=False):
|
||||
|
||||
|
||||
def check_css(jobs):
|
||||
results = pool.check_css([j.css for j in jobs])
|
||||
errors = []
|
||||
if not jobs:
|
||||
return errors
|
||||
results = pool.check_css([j.css for j in jobs])
|
||||
for job, result in zip(jobs, results):
|
||||
if isinstance(result, dict):
|
||||
for msg in result['messages']:
|
||||
|
@ -13,7 +13,7 @@ from PyQt5.Qt import (
|
||||
|
||||
from calibre.ebooks.oeb.polish.check.base import WARN, INFO, DEBUG, ERROR, CRITICAL
|
||||
from calibre.ebooks.oeb.polish.check.main import run_checks, fix_errors
|
||||
from calibre.gui2 import NO_URL_FORMATTING
|
||||
from calibre.gui2 import NO_URL_FORMATTING, safe_open_url
|
||||
from calibre.gui2.tweak_book import tprefs
|
||||
from calibre.gui2.tweak_book.widgets import BusyCursor
|
||||
from polyglot.builtins import unicode_type, range
|
||||
@ -131,6 +131,8 @@ class Check(QSplitter):
|
||||
elif url.startswith('activate:item:'):
|
||||
index = int(url.rpartition(':')[-1])
|
||||
self.location_activated(index)
|
||||
elif url.startswith('https://'):
|
||||
safe_open_url(url)
|
||||
|
||||
def next_error(self, delta=1):
|
||||
row = self.items.currentRow()
|
||||
|
Loading…
x
Reference in New Issue
Block a user