Преглед изворни кода

lisp/ob-sqlite.el: Prevent output from being incorrectly parsed if it contains double-quotes.

* lisp/ob-sqlite.el (org-babel-sqlite--read-cell): New function.
(org-babel-sqlite-table-or-scalar): Use `org-babel-sqlite--read-cell'
instead of `org-babel-string-read' to prevent data from being ignored
if it contains double-quotes.

Reported-by: learnorchids@gmail.com
Link: https://orgmode.org/list/CAK5xwica4i8h09ObzCVPx2pe-T6B0_ju_MXiduRiY7GH+PkE_A@mail.gmail.com/
Nicholas Savage пре 4 година
родитељ
комит
f8ee4ab4a7
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      lisp/ob-sqlite.el

+ 5 - 1
lisp/ob-sqlite.el

@@ -137,7 +137,7 @@ This function is called by `org-babel-execute-src-block'."
     (mapcar (lambda (row)
     (mapcar (lambda (row)
 	      (if (eq 'hline row)
 	      (if (eq 'hline row)
 		  'hline
 		  'hline
-		(mapcar #'org-babel-string-read row)))
+		(mapcar #'org-babel-sqlite--read-cell row)))
 	    result)))
 	    result)))
 
 
 (defun org-babel-sqlite-offset-colnames (table headers-p)
 (defun org-babel-sqlite-offset-colnames (table headers-p)
@@ -151,6 +151,10 @@ This function is called by `org-babel-execute-src-block'."
 Prepare SESSION according to the header arguments specified in PARAMS."
 Prepare SESSION according to the header arguments specified in PARAMS."
   (error "SQLite sessions not yet implemented"))
   (error "SQLite sessions not yet implemented"))
 
 
+(defun org-babel-sqlite--read-cell (cell)
+  "Process CELL to remove unnecessary characters."
+  (org-babel-read cell t))
+
 (provide 'ob-sqlite)
 (provide 'ob-sqlite)
 
 
 ;;; ob-sqlite.el ends here
 ;;; ob-sqlite.el ends here