Merge branch 'debian/sid' into ubuntu/trusty

This commit is contained in:
Michael Billington 2017-06-19 21:01:05 +10:00
commit 4b1d7974b8
2 changed files with 10 additions and 4 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
mdcheckr (1.2-1ubuntu1) trusty; urgency=low
* Exclude intra-page links from checks.
-- Michael Billington <michael.billington@gmail.com> Mon, 19 Jun 2017 20:58:00 +1000
mdcheckr (1.1-1ubuntu2) trusty; urgency=low
* Remove dependency on 'which' debian package.

View File

@ -38,7 +38,7 @@ function extract_links_from_html() {
# - Format as one URI per line
local _inp_file="$1"
(xmllint --nowarning --html --xpath '*//a/@href' "$_inp_file" 2> /dev/null || true) | \
sed 's/ href="\([^"]*\)"/\1\n/g'
sed 's/ href="\([^"]*\)"/\1\n/g' | grep -v "^#"
}
function extract_image_links_from_html() {
@ -59,7 +59,7 @@ function check_links() {
echo -n "- Link $_line ";
if ! check_link "$_line"; then
red "FAIL"
explain "$_inp_file" "Broken link '$_line'"
explain "$_inp_file" 1 "Broken link '$_line'"
FAILURE_COUNT=$((FAILURE_COUNT+1))
else
green "OK"
@ -76,7 +76,7 @@ function check_image_links() {
echo -n "- Image $_line ";
if ! check_link "$_line"; then
red "FAIL"
explain "$_inp_file" "Broken image '$_line'"
explain "$_inp_file" 1 "Broken image '$_line'"
FAILURE_COUNT=$((FAILURE_COUNT+1))
else
green "OK"
@ -327,7 +327,7 @@ cd $DIR
# Log number of FAILURE_COUNT
if [ "$FAILURE_COUNT" -gt 0 ]; then
echo "Done, with $FAILURE_COUNT warning(s)."
echo "Done, with $FAILURE_COUNT problems(s) found."
fi
# Use number of FAILURE_COUNT as exit code