From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: Attributes on HTML tables? Date: Mon, 08 Apr 2013 23:09:09 +0200 Message-ID: References: <86bo9rnj6q.fsf@iro.umontreal.ca> <87ppy66eke.fsf@bzg.ath.cx> <878v4uxjp6.fsf@gmail.com> <87mwtavzgv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPJHW-0002V2-RO for emacs-orgmode@gnu.org; Mon, 08 Apr 2013 17:07:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPJHO-000476-Fg for emacs-orgmode@gnu.org; Mon, 08 Apr 2013 17:07:14 -0400 In-reply-to: <87mwtavzgv.fsf@gmail.com> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Bastien , emacs-orgmode@gnu.org 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 If the user specifies #+attr_html: :border 2 :rules all :frame border :title My table I would expect the result
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