Skip to content

Commit aee35e2

Browse files
committed
HN: expand external links
1 parent 891a9b2 commit aee35e2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

news.ycombinator.com/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const styles = `
2424
padding-left: 1em;
2525
color: #ffc071;
2626
}
27+
28+
table.comment-tree .comment a {
29+
max-width: unset;
30+
text-overflow: unset;
31+
}
2732
`;
2833
const sheet = Object.assign(document.createElement("style"), {
2934
type: "text/css",
@@ -128,5 +133,10 @@ function upgradeComment(comment) {
128133
text.innerHTML = parseComment(raw);
129134
processed.add(comment);
130135
}
136+
document.querySelectorAll(".commtext a").forEach((link) => {
137+
if (link.href !== link.textContent) {
138+
link.textContent = link.href;
139+
}
140+
});
131141

132142
document.querySelectorAll(".athing.comtr").forEach(upgradeComment);

0 commit comments

Comments
 (0)