Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

WAMultiPartEmailMessageTest sends non-portable message #806

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 1 comment
Closed

WAMultiPartEmailMessageTest sends non-portable message #806

GoogleCodeExporter opened this issue Mar 25, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

WAMultiPartEmailMessageTest>>#testFromToSubjectBody and 
WAMultiPartEmailMessageTest>>#testHeaders both send #withSqueakLineEndings.

String>>#withSqueakLineEndings is both non-portable and non-intention-revealing 
(at least in the context of Seaside).

I would propose adding String>>#withHtmlLineEndings. The method name 
immediately identifies it's purpose. A portable implementation could be added 
to Grease-Core:

  withHtmlLineEndings
    (self includes: Character lf) ifFalse: [ ^ self ].  "No Lf's ; nothing to do"
    (self includes: Character cr) ifFalse: [ ^ self copyReplacingAll: (String with: Character lf) with: (String with: Character cr) ].  "Only Lf's; change them to Cr's"
    ^ (self copyReplaceAll: (String with: Character cr with: Character lf) with: (String with: Character cr)) copyReplaceAll: (String with: Character lf) with: (String with: Character cr)

or a platform-specific implementation could be added to Grease-Pharo-Core:

  withHtmlLineEndings
    ^ self withSqueakLineEndings

I would prefer the platform-specific implementation because a) it is simpler 
and b) String>>#withHtmlLineEndings is useful outside the realm of Seaside (at 
least in VA Smalltalk).




Original issue reported on code.google.com by wemb...@instantiations.com on 9 Jul 2014 at 11:23

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant