Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(macro-prompts): preserve outer quotes #2076

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/components/dialogs/TheMacroPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export default class TheMacroPrompt extends Mixins(BaseMixin) {
private checkpointEvent: ServerStateEvent | null = null
private currentPrompt: ServerStateEventPrompt[] = []
// regex that extracts the type and message, omitting the wrapping double quotes of the message (if any)
private promptMessageExp =
/^\/\/ action:prompt_(?<type>[^\s]+) *(?:(?<quote>['"])(?<msg1>.*)\k<quote>|(?<msg2>.*))\s*$/
private promptMessageExp = /^\/\/ action:prompt_(?<type>[^\s]+) *(?<msg>.*)$/

get events() {
return this.$store.state.server.events
Expand Down Expand Up @@ -95,7 +94,7 @@ export default class TheMacroPrompt extends Mixins(BaseMixin) {
break
}

const message = (match?.groups?.msg1 || match?.groups?.msg2 || '').trim()
const message = (match?.groups?.msg || '').trim()

// prepend the event to prompt events found in this chunk
promptEvents.unshift({
Expand Down
Loading