From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Carsten Dominik" Subject: Re: Blank lines in literal html Date: Mon, 17 Dec 2007 09:57:44 +0100 Message-ID: References: <475453D3.30604@gmail.com> <4756FC88.1050701@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J4BnK-00029C-Nk for emacs-orgmode@gnu.org; Mon, 17 Dec 2007 03:57:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J4BnJ-000290-8u for emacs-orgmode@gnu.org; Mon, 17 Dec 2007 03:57:50 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J4BnJ-00028x-3K for emacs-orgmode@gnu.org; Mon, 17 Dec 2007 03:57:49 -0500 Received: from wa-out-1112.google.com ([209.85.146.179]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J4BnI-0003kO-FQ for emacs-orgmode@gnu.org; Mon, 17 Dec 2007 03:57:48 -0500 Received: by wa-out-1112.google.com with SMTP id k34so3236636wah.10 for ; Mon, 17 Dec 2007 00:57:44 -0800 (PST) In-Reply-To: <4756FC88.1050701@gmail.com> Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Wanrong Lin Cc: org-mode list On Dec 5, 2007 8:31 PM, Wanrong Lin wrote: > > Finally, I decided to learn some elisp debugging techniques and as a > practice, it seems I found the bug and fixed it with this patch (against > org.el in 5.16b) > > @@ -24437,7 +24437,7 @@ > (when (re-search-backward > "\\(

\\)\\([ \t\r\n]*\\)\\=" (- (point) 100) t) > (setq par (match-string 1)) > - (replace-match "\\2\n")) > + (replace-match "")) > (insert line "\n") > (while (and lines > (get-text-property 0 'org-protected (car lines))) > > I am not completely sure whether this is the right fix, but so far the > output looks OK to me. Hi Wanrong, thanks for this patch - it is not the correct fix in this case, it is an issue having to do with the fact that an empty line cannot hold text properties, and that orgmode marks lines that are protected from processing by putting a text property on it. In this case, the fix is to continue the loop looking for additional protected lines until the first non-empty, unprotected line is found. I am fixing this in the next release. Bastien, thanks for your input on this as well. - Carsten > > Can Carsten take a look of it and see whether it is OK to check this > into the next release? Thanks a lot. > > Wanrong > > > > Wanrong Lin wrote: > > Hi, > > > > Sometimes I use "htmlize" to convert a section of my buffer into > > html and then insert it into my org file with "#+BEGIN_HTML" and > > "#+END_HTML". One thing I noticed is the blank lines in the original > > text is "amplified". For example, I have a section like this in my org > > file: > > > > #+BEGIN_HTML > >

> > Line 1
> >
> > Line 2 with a blank line in between
> > 
> > #+END_HTML > > > > When I export the above to a html file, there are actaully 3 blank > > lines between my "Line 1" and "Line 2". > > > > Is the above a bug or I mis-configured something? Thank you very much. > > > > Wanrong > > > > > > > > > >