Fix begin/end comment
commit9e15cf4fc296a5a1093aa912b0a6abd37e865f9a
authorNick Dokos <nicholas.dokos@hp.com>
Mon, 14 Mar 2011 05:48:15 +0000 (14 05:48 +0000)
committerCarsten Dominik <carsten.dominik@gmail.com>
Fri, 8 Apr 2011 10:10:32 +0000 (8 12:10 +0200)
treea3502a88ac9639ce2a310743860ab4c6720f3157
parentcd806a5d0d9d84706ead33ce8536960abb2cfe21
Fix begin/end comment

* lisp/org-exp.el (org-export-remove-comment-blocks-and-subtrees): Fix regexp.

Rasmus <rasmus.pank@gmail.com> wrote:

> Hi,
> It seems that
>
> ,----
> | #+BEGIN_COMMENT
> |  ...
> | #+END_COMMENT
> `----
>
> Might be broken in Org-mode 7.5. According to the manual,
>
> ,----
> | Finally, regions surrounded by
> |  #+BEGIN_COMMENT  ...  #+END_COMMENT  will not be exported.
> `----
>
> Consider the following example generated with Org-mode 7.5 in Emacs 24.0.50
> (started without config files).
>
> ,----
> | #+TITLE: this is a test
> |
> | #+BEGIN_COMMENT
> | Don't export me
> | #+END_COMMENT
> |
> | I'd like to be exposed
> `----
>
> The HTML export is:
>
> ,----
> | <snip>
> | <h1 class="title">this is a test</h1>
> |
> | <div class="org-comment">
> | </br>
> | <p>
> | <p>
> | Don't export me
> | </p>
> | </div>
> |
> | I'd like to be exposed
> | <snip>
> `----
>
> The LaTeX export is:
>
> ,----
> | \begin{verbatim}
> | Don't export me
> | \end{verbatim}
> | I'd like to be exposed
> `----
>

Indeed.

It seems that one of the hair-raising regexps that Carsten manages
to come up with is not quite right. Try this patch for now:

--8<---------------cut here---------------start------------->8---
--8<---------------cut here---------------end--------------->8---

Nick
lisp/org-exp.el