Skip to content

Commit c623826

Browse files
committed
update the regex
1 parent b0e9915 commit c623826

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/components/ScreenStart.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,11 @@ export default defineComponent({
9494
.map(query => query.replace.message)
9595
})
9696
const setMessagePlaceHolder = () => {
97-
// check if user modified the placeholder, if that is the case, do not update the message
98-
const messagePlaceHolderRegex = /^If you use this (?<cfftype>software|dataset), please cite it using the metadata from this file.$/igd
99-
const isMessageModifiedByApp = messagePlaceHolderRegex.exec(message.value)
100-
const testing = messagePlaceHolderRegex.test(message.value)
101-
console.log(testing)
102-
if (isMessageModifiedByApp) {
103-
setMessage(`If you use this ${type.value}, please cite it using the metadata from this file.`)
97+
const messagePlaceHolderRegex = /(software|dataset)/igm
98+
const matches = messagePlaceHolderRegex.exec(message.value)
99+
if (matches) {
100+
// search and replace all occurrences
101+
setMessage(message.value.split(matches[0]).join(type.value))
104102
}
105103
}
106104
return {

0 commit comments

Comments
 (0)