Tcl Library Source Code

View Ticket
Login
Ticket UUID: 1076403
Title: html: suggestion for a convenience "tag wrapping" proc
Type: Bug Version: None
Submitter: dgonyier Created on: 2004-12-01 00:14:24
Subsystem: html Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2019-06-25 19:10:21
Resolution: Accepted Closed By: aku
    Closed on: 2019-06-25 19:10:21
Description:
In the current version of html, wrapping text with html 
tags is a bit cumbersome in a lot of cases:

Example:

puts "[::html::openTag p]"
puts "This is my paragraph"
puts "[::html::closeTag]"

As a convenience for wrapping text or other data inside 
of tags, I would like to suggest the addition of a 
general ::html::wrapTag command that would work as 
follows:

puts [::hml::wrapTag p "This is my paragraph"]

which would output the following:

<p>This is my paragraph</p>

puts [::html::wrapTag p "foo=bar" "This is my 
paragraph"]

would output:

<p foo=bar>This is my paragraph</p>

and so on.

There are some specialized commands for wrapping 
specific tags around data, such as ::html::cell 
or ::html:row, but the above is a suggestion for a more 
general command that would wrap data in with a 
specified arbitrary tag.
User Comments: aku added on 2019-06-25 19:08:45: (text/x-fossil-wiki)
Done with commit [6a75d04948].

html bumped to version 1.5. (EF)

See also ticket [1146362fff], and [a4680273cf].

Attachments: