Jelajahi Sumber

ox-org: Remove attr_backend keywords

* lisp/ox-org.el (org-org-identity): Since back-end specific keywords
  are stripped from output, also remove attr_backend keywords.
Nicolas Goaziou 11 tahun lalu
induk
melakukan
29c02c3810
1 mengubah file dengan 4 tambahan dan 1 penghapusan
  1. 4 1
      lisp/ox-org.el

+ 4 - 1
lisp/ox-org.el

@@ -114,7 +114,10 @@ setting of `org-html-htmlize-output-type' is 'css."
 (defun org-org-identity (blob contents info)
   "Transcode BLOB element or object back into Org syntax.
 CONTENTS is its contents, as a string or nil.  INFO is ignored."
-  (org-export-expand blob contents t))
+  (let ((case-fold-search t))
+    (replace-regexp-in-string
+     "^[ \t]*#\\+ATTR_[-_A-Za-z0-9]+:\\(?: .*\\)?\n" ""
+     (org-export-expand blob contents t))))
 
 (defun org-org-headline (headline contents info)
   "Transcode HEADLINE element back into Org syntax.