Skip to content

Commit ba916ab

Browse files
committed
feat: add 35 char max limit for urls in the info box
1 parent dec1502 commit ba916ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,13 @@ function RemoteFunctions(config = {}) {
23742374
if (this.element.tagName.toLowerCase() === 'a') {
23752375
let href = this.element.getAttribute('href');
23762376
if (href && href.trim()) {
2377-
content += `<div class='href-info'>${ICONS.link} ${href.trim()}</div>`;
2377+
let displayHref = href.trim();
2378+
2379+
// this is just to safeguard from very large URLs. 35 char limit should be fine
2380+
if (displayHref.length > 35) {
2381+
displayHref = displayHref.substring(0, 35) + '...';
2382+
}
2383+
content += `<div class='href-info'>${ICONS.link} ${displayHref}</div>`;
23782384
}
23792385
}
23802386

0 commit comments

Comments
 (0)