Browse Source

ob-js: Fix error when code block ends with a comment

* lisp/ob-js.el (org-babel-js-function-wrapper): Isolate body within
  wrapper.

Reported-by: Compro Prasad <comproprasad@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110390>
Nicolas Goaziou 1 year ago
parent
commit
0dd024aa92
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/ob-js.el

+ 1 - 1
lisp/ob-js.el

@@ -55,7 +55,7 @@
   :type 'string)
 
 (defvar org-babel-js-function-wrapper
-  "require('sys').print(require('sys').inspect(function(){%s}()));"
+  "require('sys').print(require('sys').inspect(function(){\n%s\n}()));"
   "Javascript code to print value of body.")
 
 (defun org-babel-execute:js (body params)