emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [Patch] Few small fixes to html header


From: Rick Frankel
Subject: Re: [O] [Patch] Few small fixes to html header
Date: Fri, 28 Mar 2014 12:00:04 -0400
User-agent: Roundcube Webmail/0.9.0

On 2014-03-28 11:16, Marcin Antczak wrote:
Rick Frankel writes:

On 2014-03-27 15:57, Marcin Antczak wrote:
I've attached patch below, but I'm affraid that there is something
wrong
with indentation.
I'm not sure if there is problem with my settings or just entire
ox-html.el is indented badly.

Unfortunately, ox-html is indented with a combination of tabs and
spaces, you can turn on whitespace-mode to see. I'm not sure why your
saving the file has touched areas you didn't edit. Did you do a
re-indent or have a whitespace-cleanup or convert-tabs-to-spaces hook
turned on?

Why ox-html is indented in a way that doesn't follow guidelines
described on Emacs Lisp Coding Conventions?

good question. I think because it's actually a very old file.

Could we fix it?

Another good question. Bastien- Do you think it makes sense to do a
whitespace cleanup only commit of ox-html to master?


My patch fixes HTML meta data produced on export by ox-html.el

1. Meta charset definition should be set before title as document
title can contain
some unicode symbols etc.

But it's still bug.

1. Most modern browsers fallback to UTF-8 currently.
2. Charset is often set by server content type.

So, this is why you can see your example rendered correctly.
But there could be a case where it will not render properly.

Not true. This file renders incorrectly when opened from the file
system in ie 9 and chrome:

#+BEGIN_SRC html
<html>
<head>
<title>☑</title>
</head>
<body>
<p>☑ checkbox</p>
</body>
</html>
#+END_SRC

But this one renders correctly:
#+BEGIN_SRC html
<html>
<head>
<title>☑</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<p>☑ checkbox</p>
</body>
</html>
#+END_SRC

From logical point of view - charset should be first. And it's in most
html frameworks such as HTML5 Boilerplate, Twitter Bootstrap etc.

That may be, but it's a stylistic issue, not a bug. My read of the
html dtd does not specify the order of elements in the head. Can you
show me an example where the order of the elements causes incorrect
display of the title?


2. Added viewport declaration as described here:

https://github.com/h5bp/html5-boilerplate/blob/v4.3.0/doc/html.md

here:

https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html

I don't believe it's appropriate to have as a default in ox-html as
the current exporter makes no attempt at "responsive design". If you
would like your exported documents to include it, you can use the
HTML_HEAD_EXTRA property on a per-file basis, or customize the
variable `org-html-head-extra'.

Ok.

3. Fixed unnecessary "\n" at the end of Description meta.
4. Removed unnecessary spaces in meta tags.

Are these bugs or simply stylistic cleanup?

3. This is a bug for me. Meta shouldn't render closing > in new
line.

Does it cause output which is incorrectly displayed? Otherwise it's
not really a bug, but i will look at changing it the next time i need
to touch the file.

I'm worried about touching (4) w/o tests, as sometimes attributes are
concatenated, and removing a leading whitespace could cause breakage.

While source whitespace and output formatting are annoying, our
approach to modifications of this (quite old) file has been to not
make changes which don't materially affect functionality or fix bugs
(the rule of least damage :).

rick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]