mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-31 05:00:41 +00:00
Improve available anchor message.
This commit is contained in:
parent
38ac80eb1a
commit
b39158e65c
1 changed files with 5 additions and 2 deletions
|
|
@ -695,8 +695,11 @@ class UrlBase (object):
|
|||
enc = lambda anchor: urlutil.url_quote_part(anchor, encoding=self.encoding)
|
||||
if any(x for x in self.anchors if enc(x[0]) == self.anchor):
|
||||
return
|
||||
anchornames = sorted(set(u"`%s'" % x[0] for x in self.anchors))
|
||||
anchors = u", ".join(anchornames)
|
||||
if self.anchors:
|
||||
anchornames = sorted(set(u"`%s'" % x[0] for x in self.anchors))
|
||||
anchors = u", ".join(anchornames)
|
||||
else:
|
||||
anchors = u"none"
|
||||
args = {"name": self.anchor, "anchors": anchors}
|
||||
msg = u"%s %s" % (_("Anchor `%(name)s' not found.") % args,
|
||||
_("Available anchors: %(anchors)s.") % args)
|
||||
|
|
|
|||
Loading…
Reference in a new issue