Fix URL in HN completion
This commit is contained in:
parent
58acc665c1
commit
090ab9a865
|
@ -1071,13 +1071,14 @@ completions.hn.callback = (response) => {
|
||||||
}
|
}
|
||||||
const re = new RegExp(`(${res.query.split(" ").join("|")})`, "ig")
|
const re = new RegExp(`(${res.query.split(" ").join("|")})`, "ig")
|
||||||
title = title.replace(re, "<strong>$&</strong>")
|
title = title.replace(re, "<strong>$&</strong>")
|
||||||
|
const url = `https://news.ycombinator.com/item?id=${s.objectID}`
|
||||||
const li = $("<li/>").html(`
|
const li = $("<li/>").html(`
|
||||||
<div>
|
<div>
|
||||||
<div class="title">${prefix + title}</div>
|
<div class="title">${prefix + title}</div>
|
||||||
<div class="url">https://news.ycombinator.com/item?id=${s.objectID}</div>
|
<div class="url">${url}</div>
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
li.data("url", s.link)
|
li.data("url", url)
|
||||||
return li
|
return li
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue