-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only link to non broken links on First Mark page #162
Conversation
332489f
to
2f60c0b
Compare
1fe3938
to
8f3b960
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, although I’ve not tried it end-to-end locally.
I wonder whether just printing out the broken URL will make it obvious enough that the link is actually broken? Should we include "[dead link]" after it?
I’d also be tempted to make dead links look more prominent too. The aim of #146 (although I realise I didn’t document this at the time) was to warn markers when a link has died, because that might mean the evidence that got a council a mark in the previous year no longer exists. Giving the link (or <span>
if you still want it to just be plain text) a class="text-danger"
attribute might help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One typo! Aside from that, looks good.
@stringfilter | ||
def check_if_broken(text, autoescape=True): | ||
if check_if_url_bad(text): | ||
return mark_safe(f'<span class="text-danger">{text}</a>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be </span>
not </a>
d14f9a6
to
434809f
Compare
ae1df09
to
723ac35
Compare
This is currently quite unoptimised so might need improvement
Merges in 723ac35 |
Uses the list of link status codes provided by CEUK to generate a list of bad links and then uses that to only turn good URLs into links in the previous responses part of the first mark page.
Fixes #146