2 Commits

Author SHA1 Message Date
4a44fac8cf updated version number 2026-01-18 17:36:45 -05:00
5d3c76853b added URL support 2026-01-18 17:36:24 -05:00
2 changed files with 15 additions and 1 deletions

View File

@@ -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/*"],

View File

@@ -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>");