I hate reinventing the wheel ... as the man said, you are likely to get a flat. It should be a Unicode character: the wheel with one part of circumference 'flat'.
Here is some AidaWeb Smalltalk code:
streamHtmlTo: aStream for: aRequest on: aSessionBut Curl markup uses "hrule" and not "hr" and a '{' and not a '<'.
| tag |
self prepareToHtmlStreamingOn: aSession.
type = #paragraph ifTrue: [tag := 'p'].
type = #break ifTrue: [tag := 'br'].
type = #ruler ifTrue: [tag := 'hr'].
aStream nextPutAll: self ident, '<', tag.
self streamAttributesTo: aStream for: aSession.
aStream nextPutAll: self tagClosing, self eol.
Markup neutrality is not so hard to achieve - without massive duplication of classes - especially in a language such as Pharo Smalltalk with Traits as mix-ins.
No comments:
Post a Comment