--- Validate External Links/validate_external_links.sh 2020/03/25 01:59:27 1124 +++ Validate External Links/validate_external_links.sh 2020/03/25 21:50:30 1125 @@ -910,23 +910,28 @@ for LINE in `cat "$LINKS_FILE"`; do # If appropriate, record this link to the log, with clickable URLs when possible if [ $STATUS != "OK" ] || [ $RECORD_OK_LINKS -eq 1 ]; then - # Stupid hack since the strings "IW" and "EI" are narrower than "OK", "RD", or "NG" and it takes - # an extra tab to get to the desired level of indentation in the RTF log - RTF_TABS=" " + # Prepare 'curl' result in parentheses to print after status code, unless this is an "IW" or "EI" + # link, in which case showing the status code doesn't make sense. Adjust spacing after string to + # ensure TXT and RTF reports have aligned columns of results. + CURL_STR_H=" ($CURL_RESULT)" + CURL_STR_T="$CURL_STR_H" + CURL_STR_R="$CURL_STR_H " if [ $STATUS == "IW" ] || [ $STATUS == "EI" ]; then - RTF_TABS=" " + CURL_STR_H="" + CURL_STR_T=" " + CURL_STR_R=" " fi # Record link and its wiki page in TXT, RTF, and HTML markup - valPrint t "$STATUS ($CURL_RESULT) $STR_TYPE $URL" + valPrint t "${STATUS}${CURL_STR_T} $STR_TYPE $URL" valPrint t " linked from $FULL_PAGE_PATH" - valPrint r "$STATUS ($CURL_RESULT)$RTF_TABS$STR_TYPE {\field{\*\fldinst{HYPERLINK \"$URL\"}}{\fldrslt $URL}}" + valPrint r "${STATUS}${CURL_STR_R}${RTF_TABS}$STR_TYPE {\field{\*\fldinst{HYPERLINK \"$URL\"}}{\fldrslt $URL}}" valPrint r " linked from {\field{\*\fldinst{HYPERLINK \"$FULL_PAGE_PATH\"}}{\fldrslt $LOCAL_PAGE_PATH}}" - valPrint hn "