From a9899557c57f853851e391613854b51c2f581988 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 24 Nov 2016 14:18:47 +0000 Subject: [PATCH] Fix #72: Support smart quotes --- src/github.com/matrix-org/go-neb/clients/clients.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/github.com/matrix-org/go-neb/clients/clients.go b/src/github.com/matrix-org/go-neb/clients/clients.go index fec651c..4352766 100644 --- a/src/github.com/matrix-org/go-neb/clients/clients.go +++ b/src/github.com/matrix-org/go-neb/clients/clients.go @@ -192,6 +192,12 @@ func (c *Clients) onMessageEvent(client *matrix.Client, event *matrix.Event) { return } + // replace all smart quotes with their normal counterparts so shellwords can parse it + body = strings.Replace(body, `‘`, `'`, -1) + body = strings.Replace(body, `’`, `'`, -1) + body = strings.Replace(body, `“`, `"`, -1) + body = strings.Replace(body, `”`, `"`, -1) + var responses []interface{} for _, service := range services {