pretty printing ala Goldberg

Ned Konz ned at bike-nomad.com
Sun Apr 7 21:56:29 UTC 2002


or you could try to use Unicode characters (and hope that the browsers support 
them):

HtmlFileStream

nextPut: char
	"Put a character on the file, but translate it first. 4/6/96 tk 1/1/98 acg"
	char = $< ifTrue: [^ super nextPutAll: '&lt;'].
	char = $> ifTrue: [^ super nextPutAll: '&gt;'].
	char = $& ifTrue: [^ super nextPutAll: '&amp;'].
	char = $^ ifTrue: [ ^ super nextPutAll: '&#x2191;' ].
	char = $_ ifTrue: [ ^ super nextPutAll: '&#x2190;' ].
	char asciiValue = 13 "return" 
		ifTrue: [self command: 'br'].
	char = $	"tab" 
		ifTrue: [self verbatim: TabThing. ^super nextPut: char].
	^ super nextPut: char

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list