Allow to set tag in description

This commit is contained in:
Manuel Bouza
2019-03-26 16:00:02 +01:00
parent f49c0bdc3d
commit 1b1fae6f7a
3 changed files with 52 additions and 7 deletions

View File

@@ -86,3 +86,16 @@ export const formatDate = date => format(date, "YYYY-MM-DD")
export const extensionSettingsUrl = () =>
`chrome://extensions/?id=${chrome.runtime.id}`
export const extractAndSetTag = changeset => {
let { description } = changeset
const match = description.match(/^#(\S+)/)
if (!match) {
return changeset
}
return {
...changeset,
description: description.replace(/^#\S+\s/, ""),
tag: match[1]
}
}