mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not check for duplicate links in Onebox (#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.
This commit is contained in:
@@ -456,7 +456,7 @@ export default Controller.extend({
|
||||
$links.each((idx, l) => {
|
||||
const href = l.href;
|
||||
if (href && href.length) {
|
||||
// skip links in quotes
|
||||
// skip links in quotes and oneboxes
|
||||
for (let element = l; element; element = element.parentElement) {
|
||||
if (
|
||||
element.tagName === "DIV" &&
|
||||
@@ -471,6 +471,14 @@ export default Controller.extend({
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
element.tagName === "ASIDE" &&
|
||||
element.classList.contains("onebox") &&
|
||||
href !== element.dataset["onebox-src"]
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
const [warn, info] = linkLookup.check(post, href);
|
||||
|
||||
Reference in New Issue
Block a user