Bläddra i källkod

babel: Fix unquoting of strings

Before this change we have

 #+begin_src ruby :results value :session
 ["1", "3"]
 #+end_src

 #+results:
 : 1", "3

 After, we have

 #+begin_src ruby :results value :session
 ["1", "3"]
 #+end_src

 #+results:
 | 1 | 3 |
Dan Davison 15 år sedan
förälder
incheckning
a95c05773e

+ 1 - 1
contrib/babel/lisp/langs/org-babel-haskell.el

@@ -81,7 +81,7 @@
 
 (defun org-babel-haskell-read-string (string)
   "Strip \\\"s from around haskell string"
-  (if (string-match "\"\\([^\000]+\\)\"" string)
+  (if (string-match "^\"\\([^\000]+\\)\"$" string)
       (match-string 1 string)
     string))
 

+ 2 - 2
contrib/babel/lisp/langs/org-babel-python.el

@@ -208,8 +208,8 @@ last statement in BODY, as elisp."
              (org-babel-python-table-or-string (org-babel-trim (car results))))))))))
 
 (defun org-babel-python-read-string (string)
-  "Strip 's from around ruby string"
-  (if (string-match "'\\([^\000]+\\)'" string)
+  "Strip 's from around python string"
+  (if (string-match "^'\\([^\000]+\\)'$" string)
       (match-string 1 string)
     string))
 

+ 1 - 1
contrib/babel/lisp/langs/org-babel-ruby.el

@@ -202,7 +202,7 @@ last statement in BODY, as elisp."
 
 (defun org-babel-ruby-read-string (string)
   "Strip \\\"s from around ruby string"
-  (if (string-match "\"\\([^\000]+\\)\"" string)
+  (if (string-match "^\"\\([^\000]+\\)\"$" string)
       (match-string 1 string)
     string))