Open PurpleMagick opened 6 days ago
Thanks for the report. Yep,
let href = $this.attr('href');
should be
let href = $this.attr('href') || '';
This issue also affects the preview tab on MS (FIRE and MS share this code). I've already pushed code to MS, but have not, yet, been able to deploy it.
Interestingly, this error occurs in this post due to an error in parsing caused by SmokeDetector providing MS with a processed version of the HTML with all the HTML entities converted to characters. This results in the "<a>" that's supposed to be actual text (i.e., actually <a>
) being seen as a valid <a> tag. Given the processed nature of the text supplied to MS, there is, unfortunately, no way to accurately recover the real text in 100% of all cases.
If a post has an anchor tag without any href, for example
<a></a>
, then there is an error inpointRelativeURLsToSourceSESite()
.Code with reproduced here for ease of access:
href.startsWith('/')
throws an error becausehref
isundefined
.Example report with an anchor that is missing an
href
: https://m.erwaysoftware.com/posts/uid/stackoverflow/78706588Chat link for the report: https://chat.stackexchange.com/transcript/message/65904497#65904497