all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug? org-export-unravel-code inserts a spurious newline at end of inline-src-block elements
Date: Sun, 28 Aug 2016 12:04:22 +0200	[thread overview]
Message-ID: <8760qlxl95.fsf@saiph.selenimh> (raw)
In-Reply-To: <bb59c909-1ab6-90aa-3d2f-af3fde1bbc85@gmail.com> ("Clément Pit--Claudel"'s message of "Sat, 27 Aug 2016 18:44:05 -0400")

Hello,

> Exporting the following file to HTML yields the following:
>
>     #+PROPERTY: header-args :exports code
>     This code has many src_python{def}s.
>
>     <p>
>     This code has many <code class="src src-python"><span style="color: #b4fa70;">def</span>
>     </code>s.
>     </p>
>
> This renders as ~This code has many def s~, instead of the expected ~This code has many defs~.  The extra space is due to the newline after before the closing </code> tag in the HTML exported sources.
>
> This newline is added by ~org-export-unravel-code~:
>
>      ;; Get code and clean it.  Remove blank lines at its
>      ;; beginning and end.
>      (code (replace-regexp-in-string
>         "\\`\\([ \t]*\n\\)+" ""
>         (replace-regexp-in-string
>          "\\([ \t]*\n\\)*[ \t]*\\'" "\n"
>          (if (or org-src-preserve-indentation
>              (org-element-property :preserve-indent element))
>              value
>            (org-remove-indentation value)))))
>
> The documentation of this function seems slightly wrong, too, as it gets passed elements of type ~inline-src-block~:
>
>     (defun org-export-unravel-code (element)
>       "Clean source code and extract references out of it.
>
>     ELEMENT has either a `src-block' an `example-block' type.

The documentation is correct. `org-export-unravel-code' is not meant to
be called on inline source blocks since they cannot contain coderefs.

I fixed "ox-html.el" accordingly. Thank you.

Regards,

-- 
Nicolas Goaziou

      reply	other threads:[~2016-08-28 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27 22:44 Bug? org-export-unravel-code inserts a spurious newline at end of inline-src-block elements Clément Pit--Claudel
2016-08-28 10:04 ` Nicolas Goaziou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760qlxl95.fsf@saiph.selenimh \
    --to=mail@nicolasgoaziou.fr \
    --cc=clement.pit@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.