| as yet unclassified |
| attribute: anAssociation
|
| attr value |
attr _ anAssociation key asLowercase.
value _ anAssociation value.
value = false ifFalse:
[html space.
html spanClass: (self cssClassForAttribute: attr) with:
[html text: attr].
html text: '='.
html spanClass: 'attribute-value' with:
[html text: '"'.
attr = 'href'
ifTrue: [html anchorWithUrl: value do: (value size > 8 ifTrue: ['...', (value last: 8)] ifFalse: [value])]
ifFalse:
[value = true
ifFalse: [html text: value asString]
ifTrue: [html text: attr]].
html text: '"']]
|
| attributes: anAttributes
|
anAttributes ifNotNil: [anAttributes associations do: [:ea | self attribute: ea]]
|
| closeTag: aString
|
indentLevel _ indentLevel - 1.
indentCloseTags removeLast ifTrue:
[html break.
indentLevel timesRepeat: [html space]].
(self shouldPrintCloseTagFor: aString) ifTrue:
[html text: '</'.
html spanClass: (self cssClassFor: aString) with: [html text: aString].
html text: '>'].
|
| cssClassFor: aString
|
^ (self isKnownTag: aString) ifTrue: ['tag-known'] ifFalse: ['tag-unknown']
|
| cssClassForAttribute: aString
|
^ (self isKnownAttribute: aString) ifTrue: ['attribute-known'] ifFalse: ['attribute-unknown']
|
| initializeWithRenderer: aRenderer
|
html _ aRenderer.
indentCloseTags _ OrderedCollection with: false.
indentLevel _ 0
|
| isKnownAttribute: aString
|
^ self knownAttributes includes: aString asLowercase
|
| isKnownTag: aString
|
^ self knownTags includes: aString
|
| knownAttributes
|
^ #(abbr
accept-charset
accept
accesskey
action
align
alink
alt
archive
axis
background
bgcolor
bgproperties
border
cellpadding
cellspacing
char
charoff
charset
checked
cite
class
classid
clear
code
codebase
codetype
color
cols
colspan
compact
content
coords
data
datetime
declare
defer
dir
direction
disabled
encoding
enctype
face
for
frame
frameborder
framespacing
gutter
headers
height
href
hreflang
hspace
http-equiv
id
ismap
label
lang
leftmargin
link
longdesc
loop
lowsrc
marginheight
marginwidth
maxlength
media
method
methods
multiple
name
nohref
noresize
noshade
nowrap
object
onabort
onblur
onchange
onclick
ondblclick
onerror
onfocus
onkeydown
onkeypress
onkeyup
onload
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup
onreset
onselect
onsubmit
onunload
prompt
PUBLIC
readonly
rel
rev
rows
rowspan
rules
scheme
scope
scrolling
selected
shape
size
span
src
standby
style
summary
tabindex
target
text
title
type
urn
usemap
valign
value
valuetype
version
vlink
vspace
width
wrap
xml:lang
xmlns)
|
| knownTags
|
^ #(?xml
!doctype
!dt
a
abbr
acronym
address
applet
area
attach
b
base
basefont
bdo
big
blink
blockquote
body
br
button
caption
center
cite
code
col
colgroup
comment
component
dd
del
dfn
dir
div
dl
dt
em
fieldset
font
form
frame
frameset
h
h1
h2
h3
h4
h5
h6
head
hr
html
i
iframe
img
input
ins
isindex
kbd
label
legend
li
link
listing
map
menu
meta
multicol
nextid
nobr
noframes
noscript
object
ol
optgroup
option
p
param
plaintext
pre
q
s
samp
script
select
small
span
strike
strong
style
sub
sup
table
tbody
td
textarea
textflow
tfoot
th
thead
title
tr
tt
u
ul
var
wbr
xmp)
|
| openTag: aString attributes: anAttributes
|
html break.
indentLevel timesRepeat: [html space].
html text: '<'.
html spanClass: (self cssClassFor: aString) with: [html text: aString].
self attributes: anAttributes.
(self shouldPrintCloseTagFor: aString)
ifFalse: [html space; text: '/'].
html text: '>'.
indentLevel _ indentLevel + 1.
indentCloseTags removeLast; addLast: true; addLast: false.
|
| text: aString
|
html text: aString
|