You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reportBody.find('a').each(function () {
const $this = $(this);
let href = $this.attr('href');
if (!/^(?:[a-z]+:)?\/\//.test(href)) {
// It's not a fully qualified or protocol-relative link.
if (href.startsWith('/')) {
href.startsWith('/') throws an error because href is undefined.
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
The text was updated successfully, but these errors were encountered: