Skip to content

FIRE: anchor tags without an href lead to an error #239

Description

@PurpleMagick

If a post has an anchor tag without any href, for example <a></a>, then there is an error in pointRelativeURLsToSourceSESite().

Code with reproduced here for ease of access:

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.

Example report with an anchor that is missing an href: https://m.erwaysoftware.com/posts/uid/stackoverflow/78706588

Chat link for the report: https://chat.stackexchange.com/transcript/message/65904497#65904497

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions