emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* HTML-Export Images with #+ATTR_HTML: broken?
@ 2013-05-07 16:26 Robert Eckl
  2013-05-07 16:56 ` [PATCH] ox-html: Ensure space between tag and attribute when closing tags Lawrence Mitchell
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Eckl @ 2013-05-07 16:26 UTC (permalink / raw)
  To: emacs-orgmode

With Org-mode version 8.0.2 (release_8.0.2-91-g29ab1b )
the html-Exporter seems to ommit a space after the img-Tag

#+begin_src orgmode
* Test HTML-Export images
#+ATTR_HTML:  :width  440px 
 [[orgmode.org][http://orgmode.org/img/org-mode-unicorn-logo.png]]

** ohne Verlinkung
#+ATTR_HTML:  :width  220px 
[[http://orgmode.org/img/org-mode-unicorn-logo.png]]
#+end_src

results in

...
#+begin_src html
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Test HTML-Export images</h2>
<div class="outline-text-2" id="text-1">
<p>
<i><imgwidth="440px" src="http://orgmode.org/img/org-mode-unicorn-logo.png" alt="org-mode-unicorn-logo.png" /></i>
</p>
</div>

<div id="outline-container-sec-1-1" class="outline-3">
<h3 id="sec-1-1"><span class="section-number-3">1.1</span> ohne Verlinkung</h3>
<div class="outline-text-3" id="text-1-1">

<div class="figure">
<p><imgwidth="220px" src="http://orgmode.org/img/org-mode-unicorn-logo.png" alt="org-mode-unicorn-logo.png" /></p>
</div>
#+end_src
...

The space between "img" and the attribute "width" is missing.

Cu,

Robert

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ox-html: Ensure space between tag and attribute when closing tags
  2013-05-07 16:26 HTML-Export Images with #+ATTR_HTML: broken? Robert Eckl
@ 2013-05-07 16:56 ` Lawrence Mitchell
  2013-05-07 19:50   ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Lawrence Mitchell @ 2013-05-07 16:56 UTC (permalink / raw)
  To: emacs-orgmode

* lisp/ox-html.el (org-html-close-tag): Add space before attr.

We might get an attribute to a tag with no space at its start.  Rather
than auditing all callers, unconditionally separate the tag from its
attributes with a space when closing the tag.
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Robert Eckl wrote:
> The space between "img" and the attribute "width" is missing.

Attributes coming from the buffer didn't get a space prepended.
Here's a fix.

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 05b99bf..0379567 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1301,7 +1301,7 @@ CSS classes, then this prefix can be very useful."
 	(member dt '("html5" "xhtml5" "<!doctype html>"))))
 
 (defun org-html-close-tag (tag attr info)
-  (concat "<" tag (or attr "")
+  (concat "<" tag " " attr
 	  (if (org-html-xhtml-p info) " />" ">")))
 
 (defun org-html--make-attribute-string (attributes)
-- 
1.8.2-rc3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ox-html: Ensure space between tag and attribute when closing tags
  2013-05-07 19:50   ` Bastien
@ 2013-05-07 17:58     ` Lawrence Mitchell
  2013-05-07 20:05       ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Lawrence Mitchell @ 2013-05-07 17:58 UTC (permalink / raw)
  To: emacs-orgmode

Bastien wrote:
> Hi Lawrence,

> Lawrence Mitchell <wence@gmx.li> writes:

>> * lisp/ox-html.el (org-html-close-tag): Add space before attr.

> thanks for the patch -- can you make it against the maint branch
> so that we include this in the next minor release?  It does not
> apply against master.

It won't apply against maint because the ox-html changes that
introduced the problem (9bc55c, Export to various flavors of
(X)HTML) are on master, not maint.

My patch definitely applies against master:

$ git checkout master
$ git describe
release_8.0.2-91-g29ab1bb
$ git am ...
$ git diff origin/master
diff --git c/lisp/ox-html.el w/lisp/ox-html.el
index 05b99bf..0379567 100644
--- c/lisp/ox-html.el
+++ w/lisp/ox-html.el
@@ -1301,7 +1301,7 @@ CSS classes, then this prefix can be very useful."
        (member dt '("html5" "xhtml5" "<!doctype html>"))))
 
 (defun org-html-close-tag (tag attr info)
-  (concat "<" tag (or attr "")
+  (concat "<" tag " " attr
          (if (org-html-xhtml-p info) " />" ">")))
 
 (defun org-html--make-attribute-string (attributes)


-- 
Lawrence Mitchell <wence@gmx.li>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ox-html: Ensure space between tag and attribute when closing tags
  2013-05-07 16:56 ` [PATCH] ox-html: Ensure space between tag and attribute when closing tags Lawrence Mitchell
@ 2013-05-07 19:50   ` Bastien
  2013-05-07 17:58     ` Lawrence Mitchell
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2013-05-07 19:50 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: emacs-orgmode

Hi Lawrence,

Lawrence Mitchell <wence@gmx.li> writes:

> * lisp/ox-html.el (org-html-close-tag): Add space before attr.

thanks for the patch -- can you make it against the maint branch
so that we include this in the next minor release?  It does not
apply against master.

Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ox-html: Ensure space between tag and attribute when closing tags
  2013-05-07 17:58     ` Lawrence Mitchell
@ 2013-05-07 20:05       ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2013-05-07 20:05 UTC (permalink / raw)
  To: Lawrence Mitchell; +Cc: emacs-orgmode

Lawrence Mitchell <wence@gmx.li> writes:

> It won't apply against maint because the ox-html changes that
> introduced the problem (9bc55c, Export to various flavors of
> (X)HTML) are on master, not maint.

I overlooked this.  Applied, thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-07 18:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-07 16:26 HTML-Export Images with #+ATTR_HTML: broken? Robert Eckl
2013-05-07 16:56 ` [PATCH] ox-html: Ensure space between tag and attribute when closing tags Lawrence Mitchell
2013-05-07 19:50   ` Bastien
2013-05-07 17:58     ` Lawrence Mitchell
2013-05-07 20:05       ` Bastien

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).