emacs-devel
[Top][All Lists]
Advanced

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

Re: table.el downcase HTML tags


From: Ted Zlatanov
Subject: Re: table.el downcase HTML tags
Date: Wed, 31 May 2006 10:33:25 -0400
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

On 30 May 2006, address@hidden 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) "/") ">"))
>
> giving
>
> (table--generate-source-html-tag "a" "b" "c=d")
> => "<a c=d>b</a>"
> (table--generate-source-html-tag "a")
> => "<a/>"

Sure, that works :)

> 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:
>
> (table--generate-source-html-tag "a" "")
> => "<a></a>"

Actually all this and more is covered by sgml-mode's sgml-tag (and
friends).  Perhaps they should be used here instead of reinventing the
wheel.

Ted





reply via email to

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