[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CL
[O] [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CLASS
Sat, 01 Sep 2012 03:31:06 -0700
When exporting a subtree with an HTML_CONTAINER_CLASS property set,
exporting fails with this error: (error "Before first headline at
position 455 in buffer *temp*") This happens because the system is
trying to apply the class to the parent level, but the exporting of a
subtree doesn't bring the parent level into the temp buffer.
The attached patch modifies org-export-remember-html-container-classes
to ignore the HTML_CONTAINER_CLASS property altogether in these cases.
It would probably be better to apply the designated class to the
container div or perhaps the body, but this change works for me, and I
may be the only one bothered by this.
If it is determined that another fix is more in the spirit of these
files, I will not be offended.
ChangeLog entry: Fix export of subtree with HTML_CONTAINER_CLASS
Modify org-export-remember-html-container-classes to work around problem
when exporting subtree with HTML_CONTAINER_CLASS property.
All the best,
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index c901a88..875bdf8 100644
@@ -1476,8 +1476,11 @@ the current file."
"^[ \t]*:HTML_CONTAINER_CLASS:[ \t]+\\(.+\\)$" nil t)
(setq class (match-string 1))
+ (if (re-search-backward "^\\*" (point-min) t)
(put-text-property (point-at-bol) (point-at-eol) 'html-container-class
(defvar org-export-format-drawer-function nil
"Function to be called to format the contents of a drawer.
- [O] [PATCH] Works around bug in exporting subtree with HTML_CONTAINER_CLASS,
T.F. Torrey <=