Diferencia entre revisiones de «Módulo:HtmlBuilder»
m Miguillen movió la página Module:Module:HtmlBuilder a Module:HtmlBuilder sin dejar una redirección |
Sin resumen de edición |
||
| Línea 43: | Línea 43: | ||
end | end | ||
table.insert(ret, '"') | table.insert(ret, '"') | ||
end | |||
if t.selfClosing then | |||
table.insert(ret, ' /') | |||
end | end | ||
table.insert(ret, '>') | table.insert(ret, '>') | ||
| Línea 55: | Línea 58: | ||
end | end | ||
end | end | ||
if t.tagName and not t.unclosed then | if t.tagName and not t.unclosed and not t.selfClosing then | ||
table.insert(ret, '</' .. t.tagName .. '>') | table.insert(ret, '</' .. t.tagName .. '>') | ||
end | end | ||
| Línea 99: | Línea 102: | ||
metatable.attr = function(t, name, val) | metatable.attr = function(t, name, val) | ||
-- | -- if caller sets the style attribute explicitly, then replace all styles previously added with css() and cssText() | ||
if name == 'style' then | if name == 'style' then | ||
t.styles = {val} | t.styles = {val} | ||
| Línea 171: | Línea 174: | ||
builder.parent = args.parent | builder.parent = args.parent | ||
builder.unclosed = args.unclosed or false | builder.unclosed = args.unclosed or false | ||
builder.selfClosing = args.selfClosing or false | |||
return builder | return builder | ||
end | end | ||
return HtmlBuilder | return HtmlBuilder | ||