[squeak-dev] given String 'Foo <nowiki>Bar</nowiki> Baz' yield String 'Foo Baz'

Eliot Miranda eliot.miranda at gmail.com
Fri Dec 25 19:46:25 UTC 2020


Hi Tim,

On Fri, Dec 25, 2020 at 9:29 AM gettimothy via Squeak-dev <
squeak-dev at lists.squeakfoundation.org> wrote:

> Hi folks,
>
> I did not see anything obvious to do the above, and I am writing some
> really ugly code to get the task done.
>
> Is anybody aware of a simple message send like...
>
> 'Foo <nowiki>Bar</nowiki> Baz' removeAllBetween:'<nowiki>' and:
> '</nowiki>'.
>
> thx in advance.
>

You can rely on your own parsing, but if you're at all likely to expand
into a broader HTML space then explore the HTML Framework.  For example,
this doesn't do what you want but it gets you close and is generally
powerful enough for any and all HTML parsing tasks.

(HTMLParser parse: 'Foo <nowiki>Bar</nowiki> Baz') contents last
textualContents => 'Foo Bar Baz'


_,,,^..^,,,_
Happy Holidays, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20201225/6840c347/attachment.html>


More information about the Squeak-dev mailing list