[Top][All Lists]

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

Re: table.el downcase HTML tags

From: Lennart Borgman
Subject: Re: table.el downcase HTML tags
Date: Wed, 31 May 2006 00:42:22 +0200
User-agent: Thunderbird (Windows/20060308)

Stuart D. Herring wrote:
I'd use

(defun table--generate-source-html-tag (tag &optional body attrs)
  (when table-uppercase-html-tags (setq tag (upcase tag)))
  (concat "<" tag (if attrs " ") attrs
          (if body (concat ">" body "</" tag) "/") ">"))


(table--generate-source-html-tag "a" "b" "c=d")
 => "<a c=d>b</a>"
(table--generate-source-html-tag "a")
 => "<a/>"

I removed the spaces around the body because they could break things and
are trivial to include in the argument.  I'd really be tempted to make
attrs an alist, but that might be overengineering the problem.  The
XML-style empty tags might be undesirable, but they're optional:

Option values should be surrounded by "". An alist should be better to avoid problems with this.

reply via email to

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