printOut(AsHTML)

Gerardo Richarte gera at core-sdi.com
Mon Nov 2 18:25:17 UTC 1998


Hi!
    In order to make printOut(AsHtml) work properly we needed to add
#verbatim: and to change #nextPut: in HtmlFileStream, here are our
versions, there may be better, as ussual...

nextPut: char
    "Put a character on the file, but translate it first. 4/6/96 tk"
    char = $< ifTrue: [^ super nextPutAll: '&lt;'].
    char = $> ifTrue: [^ super nextPutAll: '&gt;'].
    char = $& ifTrue: [^ super nextPutAll: '&amp;'].
    char asciiValue = 13 "return" ifTrue: [
        self command: 'br'].
    char = $ "tab" ifTrue:
    [self verbatim: '&nbsp;&nbsp;&nbsp;&nbsp;'].    "this line changed"
    ^ super nextPut: char

verbatim: aString
    "Write the whole string, without translating it. r++ 11/2/1998
14:46"
    "Needed here so printOutAsHtml works ok"

    aString do: [:each | super nextPut: each].

    I hope you have a nice printing...

    Printed Bye!
    Richie++





More information about the Squeak-dev mailing list