mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-10-18 02:19:46 +00:00
ob-lua: Escape double quote characters in results
* lisp/ob-lua.el (org-babel-lua-wrapper-method): Escape all double quote characters in Lua before giving them to Org Babel. * testing/lisp/test-ob-lua.el (test-ob-lua/escaping-quotes): Test automatic escaping of double quote characters. Reported-by: Max Nikulin <manikulin@gmail.com> Link: https://list.orgmode.org/216278dc-075c-47d1-94dc-f5bde8346b3c@gmail.com/
This commit is contained in:
parent
73da6beb50
commit
3ccc1ca6ec
@ -283,7 +283,7 @@ function dump(it, indent)
|
||||
end
|
||||
return result
|
||||
else
|
||||
return tostring(it)
|
||||
return string.gsub(tostring(it), '\"', '\\\"')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -176,6 +176,12 @@ return x
|
||||
(org-test-with-temp-text "src_lua{return 1, 2, 3}"
|
||||
(org-babel-execute-src-block))))))
|
||||
|
||||
(ert-deftest test-ob-lua/escaping-quotes ()
|
||||
(should
|
||||
(equal "A \" B"
|
||||
(org-test-with-temp-text "src_lua{return 'A \" B'}"
|
||||
(org-babel-execute-src-block)))))
|
||||
|
||||
(provide 'test-ob-lua)
|
||||
|
||||
;;; test-ob-lua.el ends here
|
||||
|
Loading…
Reference in New Issue
Block a user