From: Christian Moe <mail@christianmoe.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Bastien <bzg@gnu.org>, emacs-orgmode@gnu.org
Subject: Re: Attributes on HTML tables?
Date: Mon, 08 Apr 2013 23:09:09 +0200 [thread overview]
Message-ID: <m2ip3wybka.fsf@christianmoe.com> (raw)
In-Reply-To: <87mwtavzgv.fsf@gmail.com>
Nicolas Goaziou writes:
> Does every possible attribute follow attribute="value" pattern? Aren't
> there single keywords?
In XHTML it does, and there aren't. In HTML you can use some "minimized"
attributes, but in XHTML they have their own names as values,
e.g. nowrap="nowrap".
> If they are that regular, we can indeed walk the
> plist like a list and change
>
> (:key1 val1 :key2 val2 ...)
>
> into
>
> key1="val1" key2="val2"
...and let the user worry about getting them right. That's my
suggestion, FWIW.
> If there are irregular keywords, the export back-end needs to know about
> them.
XML doesn't do `irregular'. :)
XHTML is also fussy about quoting attribute values, and about escaping
special characters as HTML entities, including the ampersand (&), and
including inside attribute values. I'm guessing the exporter already
does the right thing here.
Since values may legitimately contain double quotes, one thing the
back-end *does* need to know about is to put those in single quotes:
:title This is a "pop-up" text
title='This is a "pop-up" text'
> Also, if attributes are provided, I assume defaults should be ignored
> altogether. Or do we need to create the union between default values and
> provided attributes?
If I understand the question correctly, I think the union is the correct
answer, with provided attributes overwriting defaults for the same
attributes.
In the example we started with, the defaults would create
<table border="2" cellspacing="0" cellpadding="6" rules="groups"
frame="hsides">
If the user specifies
#+attr_html: :border 2 :rules all :frame border :title My table
I would expect the result
<table border="2" cellspacing="0" cellpadding="6" rules="all"
frame="border" title="My table">
You may want a second opinion on all this -- I'm no (X)HTML guru and
I've never written an exporter. But it seems to me the pure plist form
would less confusing to the user than a split syntax, and easier to
maintain, as well.
Yours,
Christian
next prev parent reply other threads:[~2013-04-08 21:07 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-07 2:55 Attributes on HTML tables? François Pinard
2013-04-07 6:27 ` Bastien
2013-04-07 14:42 ` Christian Moe
2013-04-07 18:46 ` Nicolas Goaziou
2013-04-07 20:39 ` Christian Moe
2013-04-07 20:48 ` Nicolas Goaziou
2013-04-08 21:09 ` Christian Moe [this message]
2013-04-10 17:44 ` François Pinard
2013-04-12 2:06 ` Eric Abrahamsen
2013-04-12 5:42 ` Bastien
2013-04-12 6:01 ` Eric Abrahamsen
2013-04-12 8:46 ` Bastien
2013-04-12 14:36 ` François Pinard
2013-04-13 3:38 ` Eric Abrahamsen
2013-04-13 5:31 ` Eric Abrahamsen
2013-04-13 20:42 ` Rick Frankel
2013-04-14 10:13 ` Eric Abrahamsen
2013-04-14 18:01 ` Rick Frankel
2013-04-15 18:03 ` Rick Frankel
2013-04-13 17:10 ` Rick Frankel
2013-04-14 8:41 ` Bastien
2013-04-10 19:37 ` Nicolas Goaziou
2013-04-11 8:28 ` Christian Moe
2013-04-11 10:55 ` Nicolas Goaziou
2013-04-11 12:14 ` Christian Moe
2013-04-11 15:34 ` Bastien
2013-04-11 17:29 ` Nicolas Goaziou
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=m2ip3wybka.fsf@christianmoe.com \
--to=mail@christianmoe.com \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
/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.