FIX: Do not check for duplicate links in Onebox (PR #13345)

If a user posted a URL that appeared inside a Onebox, then the user got a duplicate link notice. This was fixed by skipping those links in Ruby.

If a user posted a URL that was Oneboxes and contained other links that appeared in previous posts, then the user got a duplicate link notice. This was fixed by skipping those links in JavaScript.

GitHub

You can do this to ensure the onebox has a data-onebox-src attribute.

    doc.css("aside.onebox[data-onebox-src]").each { |onebox| links << DetectedLink.new(onebox["data-onebox-src"], false) }

Since we don’t need those links, you could remove them from the DOM

    doc.css("aside.quote a, aside.onebox a, .elided a").remove

The comment above “skip links in quotes” won’t be accurate anymore :wink: