From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Subject: Bug? org-export-unravel-code inserts a spurious newline at end of inline-src-block elements Date: Sat, 27 Aug 2016 18:44:05 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KFw7QOkGtGBWQH3cOov54LXe8bn1fnQVb" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdmKo-0001JQ-QC for emacs-orgmode@gnu.org; Sat, 27 Aug 2016 18:44:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bdmKk-00039H-J9 for emacs-orgmode@gnu.org; Sat, 27 Aug 2016 18:44:17 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:50548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bdmKk-000394-8w for emacs-orgmode@gnu.org; Sat, 27 Aug 2016 18:44:14 -0400 Received: from [18.189.127.88] ([18.189.127.88]) by mrelayeu.kundenserver.de (mreue002) with ESMTPSA (Nemesis) id 0M8u6u-1bpus414wO-00CCoW for ; Sun, 28 Aug 2016 00:44:12 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KFw7QOkGtGBWQH3cOov54LXe8bn1fnQVb Content-Type: multipart/mixed; boundary="0g85q7LgeQfA4ooUUSpe2dJU8g2QkDaH4" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: emacs-orgmode@gnu.org Message-ID: Subject: Bug? org-export-unravel-code inserts a spurious newline at end of inline-src-block elements --0g85q7LgeQfA4ooUUSpe2dJU8g2QkDaH4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Exporting the following file to HTML yields the following: #+PROPERTY: header-args :exports code This code has many src_python{def}s.

This code has many def s.

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 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. I'd be happy to provide a patch, but it's not clear that it's a good idea= to always remove the last blank line, so I'd rather defer to experts on = these matters :) Cheers, Cl=C3=A9ment. --0g85q7LgeQfA4ooUUSpe2dJU8g2QkDaH4-- --KFw7QOkGtGBWQH3cOov54LXe8bn1fnQVb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXwhe6AAoJEPqg+cTm90wjB/cQALVjev+24OduSM33GoBsekyG F97C8aA4Otk7Hk0DJdBfpC1yKGBXX9+XtS9trY/SNBtrgE9BjOjG/UJfInqsArWd WSrhbNDaXSZsVF6NjjwaaquwZWNBtZ5FNDnYlPVpwwxtdAEYtC4yXr54kyQU5C5u NKjzGPg78iF5K6U462gXuh4ng3iyQNZIMjve4sp8HWCnwMm4GEBvxEgkzQ5O+FdQ xnnDd7oi2UnGbJInh/mMYuxCZrpTiEgWrhqGYM9x2hHccvTossIl1OJ9fl4cCi3C YOOL1swOACRIizussUGlvVJRDYvnudl3T/H1EoBHLHzjnBGxTQO4g+vP8IqKKUTn uoFKsctWi7+PowAF2XVEiVs4aIjc3Cn9YQ/subienLJb1qFOQRTe+uioHqzQaz1Y U40stKjLj/W51+U/Oga7+7+az6GfHxk63AcpMltvszBqjj58CVy3FT+j3i8w31Gr v5jQISkiC21hqMdiq2fjhVIXzNyQZhDlU8taQw4E9ko/NqRNd90Y3EKg4LSwiKpe h9xC1e+oiPrXWXy/ZNNrP68nipOGU22QNVhQw1Mjed7aj2jLRZZgqgtTtx1kzg2c a+YSghbRNqESX711P2LOMct9Bi1rB7Gh6OQ9OJD2VOLCBEvnuHb5+VFK02A1WuGZ tj/R9XeK1ffxRgaT0nZn =ARro -----END PGP SIGNATURE----- --KFw7QOkGtGBWQH3cOov54LXe8bn1fnQVb--