branch: externals/firefox-javascript-repl
commit 9644f919dd32a4bdd0391e178404d36cbe424152
Author: Thomas Fitzsimmons <[email protected]>
Commit: Thomas Fitzsimmons <[email protected]>

    Fix string quoting
    
    * firefox-javascript-repl.el (fjrepl--input-sender): Escape double
    quotes.
---
 firefox-javascript-repl.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/firefox-javascript-repl.el b/firefox-javascript-repl.el
index 8d92321874..4433d719be 100644
--- a/firefox-javascript-repl.el
+++ b/firefox-javascript-repl.el
@@ -54,7 +54,6 @@ ARGUMENTS will be used for FORMAT, like `messages'."
   "The prompt used in the Firefox JavaScript buffer.")
 
 ;; fixme: font-lock.
-;; fixme: fix "" quoting.
 (defun fjrepl--input-sender (process string)
   "Send to PROCESS the STRING.  Set `comint-input-sender' to this function."
   (process-send-string process (fjrepl--format-message
@@ -63,7 +62,8 @@ ARGUMENTS will be used for FORMAT, like `messages'."
                                 (concat "{\"type\":\"evaluateJSAsync\","
                                         "\"text\":\"%s\","
                                         "\"to\":\"%s\"}")
-                                string fjrepl--console-actor)))
+                                (replace-regexp-in-string "\"" "\\\\\"" string)
+                                fjrepl--console-actor)))
 
 (define-derived-mode firefox-javascript-repl-mode comint-mode "FJ"
   "Major mode for interactively evaluating JavaScript expressions in Firefox."

Reply via email to