a_row_code="""<tr class="fail" bgcolor="#FF0000"><td>Invalid Link Number """+str(invalid_counter)+"""</td><td>"""+"""This link is not string, which indicates that your MD file may not be well-formed."""+"""</td><td>"""+key+"""</td></tr>"""
withopen(report_name,"a",encoding="utf-8")asf:
f.write(a_row_code)
continue
# MD files that are not well-formed may raise exceptions. If parentheses are not correctly escaped, a NoneType object may be returned
status_code)+""" The URL looks good but the anchor link does not work or is not using an anchor tag."""+"""</td><td>"""+key+"""</td></tr>""""""</td></tr>"""
# File path formats on Windows systems from https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats
# C:\Documents\Newsletters\Summer2018.pdf An absolute file path from the root of drive C:
# \Program Files\Custom Utilities\StringFinder.exe An absolute path from the root of the current drive.
# 2018\January.xlsx A relative path to a file in a subdirectory of the current directory.
# ..\Publications\TravelBrochure.pdf A relative path to file in a directory that is a peer of the current directory.
# C:\Projects\apilibrary\apilibrary.sln An absolute path to a file from the root of drive C:
# C:Projects\apilibrary\apilibrary.sln A relative path from the current directory of the C: drive.
# We do not use absolute path formats in MD files and path formats are not likely to be from the root of the current drive. So here are possible formats:
f.write("""<p><strong>The number of failed links:</strong> """+str(fail_count)+""". <strong>The number of passed links:</strong> """+str(pass_count)+""" <strong>Pass rate:</strong> """+str(float(pass_count/(pass_count+fail_count))*100)+'%')
f.write("""<p>Click the button to sort the table by parent page:</p>