浏览代码

ox: Fix "Wrong argument type" error when attributes start with :key ""

* lisp/ox.el (org-export-read-attribute): Fix "Wrong argument type"
  error when attributes start with :key "".
Nicolas Goaziou 12 年之前
父节点
当前提交
4b7006f444
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      lisp/ox.el

+ 5 - 4
lisp/ox.el

@@ -3460,10 +3460,11 @@ double quotes will be read as-is, which means that \"\" value
 will become the empty string."
   (let* ((prepare-value
 	  (lambda (str)
-	    (cond ((member str '(nil "" "nil")) nil)
-		  ((string-match "^\"\\(\"+\\)?\"$" str)
-		   (or (match-string 1 str) ""))
-		  (t str))))
+	    (save-match-data
+	      (cond ((member str '(nil "" "nil")) nil)
+		    ((string-match "^\"\\(\"+\\)?\"$" str)
+		     (or (match-string 1 str) ""))
+		    (t str)))))
 	 (attributes
 	  (let ((value (org-element-property attribute element)))
 	    (when value