Compare commits
2 Commits
605cd93aa6
...
4a44fac8cf
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a44fac8cf | |||
| 5d3c76853b |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "WWCompanion",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"description": "AI companion for WaterlooWorks job postings.",
|
||||
"permissions": ["storage", "activeTab"],
|
||||
"host_permissions": ["https://waterlooworks.uwaterloo.ca/*"],
|
||||
|
||||
@@ -84,6 +84,20 @@ function applyInline(text) {
|
||||
)}" target="_blank" rel="noreferrer">${label}</a>`;
|
||||
});
|
||||
|
||||
output = output.replace(/https?:\/\/[^\s<]+/g, (match) => {
|
||||
let url = match;
|
||||
let suffix = "";
|
||||
while (/[),.;!?]$/.test(url)) {
|
||||
suffix = url.slice(-1) + suffix;
|
||||
url = url.slice(0, -1);
|
||||
}
|
||||
const safeUrl = sanitizeUrl(url);
|
||||
if (!safeUrl) return match;
|
||||
return `<a href="${escapeAttribute(
|
||||
safeUrl
|
||||
)}" target="_blank" rel="noreferrer">${safeUrl}</a>${suffix}`;
|
||||
});
|
||||
|
||||
output = output.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>");
|
||||
output = output.replace(/\*([^*]+)\*/g, "<em>$1</em>");
|
||||
output = output.replace(/_([^_]+)_/g, "<em>$1</em>");
|
||||
|
||||
Reference in New Issue
Block a user