Fix nil output <a> name attribute conversion
The attribute described(link below) was being converted incorrectly for certain pages I tried. https://www.w3schools.com/tags/att_a_name.asp
I created this gist based on the page I was trying to convert and before fix I was getting -
'<a name="sp"> </a>' # => [ ]
'<a name="serno">87471742</a>' #> [87471742]
I admit this is really badly written non-html5 doc, but I really need to convert this for a project in production. After this fix, these conversions are fine. Kindly, merge this fix. Thanks!
Thank you for the PR! Can you please include a test case that illustrates the change?
Hi @soundasleep, I think we shouldn't convert 'a' tags to markdown like syntax when they have name attributes?
Example
# Expected Behavior
<a name="serno">87471742</a> #> 87471742
# Actual Behavior
<a name="serno">87471742</a> #> [87471742]
The actual behavior works well when the 'a' tag has an href attribute but for name attributes, it shouldn't add the square brackets. What do you think?
I think your proposal is totally fine. If an <a> tag does not have any href, then it shouldn't display as a link. Can you write this into your commit and add a test case (or two) showing the difference, and get the test to pass on travis-ci? Thank you!