Update projecte regex to match on alphanumeric values with hyphens

This commit is contained in:
Manuel Bouza
2019-03-30 07:51:59 +01:00
parent d8398fca5f
commit 6dbadd14a2

View File

@@ -1,4 +1,4 @@
const projectRegex = /\[(\d+)\]/ const projectRegex = /\[([\w-]+)\]/
export default { export default {
asana: { asana: {
@@ -22,7 +22,7 @@ export default {
const match = document const match = document
.querySelector(".ProjectPageHeader-projectName") .querySelector(".ProjectPageHeader-projectName")
?.textContent?.trim() ?.textContent?.trim()
?.match(/^\[(\w+)\]/) ?.match(projectRegex)
return match && match[1] return match && match[1]
} }
}, },