@@ -136,7 +136,7 @@ specifying a variable of the same value."
(if (equal var 'hline)
org-babel-python-hline-to
(format
- (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%s\"\"" "%s")
+ (if (and (stringp var) (string-match "[\n\r]" var)) "\"\"%S\"\"" "%S")
var))))
(defun org-babel-python-table-or-string (results)
@@ -255,7 +255,8 @@ a communication channel."
(off "[ ] "))
(let ((tag (org-element-property :tag item)))
(and tag (format "**%s:** "(org-export-data tag info))))
- (org-trim (replace-regexp-in-string "^" " " contents)))))
+ (and contents
+ (org-trim (replace-regexp-in-string "^" " " contents))))))