[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squeak-dev
Subject:    Re: [squeak-dev] given String 'Foo <nowiki>Bar</nowiki> Baz' yield String 'Foo Baz'
From:       Eliot Miranda <eliot.miranda () gmail ! com>
Date:       2020-12-25 19:46:25
Message-ID: CAC20JE2Vev2+TYgDNDWPnA83Xt8T1oYZ_bbqZ4aXKPZhRFW_JQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Tim,

On Fri, Dec 25, 2020 at 9:29 AM gettimothy via Squeak-dev <
squeak-dev@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

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" \
style="font-size:large">Hi Tim,</div></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">On Fri, Dec 25, 2020 at 9:29 AM gettimothy via \
Squeak-dev &lt;<a href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.squeakfoundation.org</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u><div><div \
style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10pt"><div>Hi \
folks,<br></div><div><br></div><div>I did not see anything obvious to do the above, \
and I am writing some really ugly code to get the task done.<br></div><br>Is anybody \
aware of a simple message send like...<br><br><blockquote style="border:1px solid \
rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div>&#39;Foo \
&lt;nowiki&gt;Bar&lt;/nowiki&gt; Baz&#39; removeAllBetween:&#39;&lt;nowiki&gt;&#39; \
and: &#39;&lt;/nowiki&gt;&#39;.<br></div></blockquote><div>thx in \
advance.</div></div></div></blockquote><div><br></div><div class="gmail_default">You \
can rely on your own parsing, but if you&#39;re at all likely to expand into a \
broader HTML space then explore the HTML Framework.   For example, this doesn&#39;t \
do what you want but it gets you close and is generally powerful enough for any and \
all HTML parsing tasks.</div><div class="gmail_default"><br></div><div \
class="gmail_default">(HTMLParser parse: &#39;Foo &lt;nowiki&gt;Bar&lt;/nowiki&gt; \
Baz&#39;) contents last textualContents =&gt; &#39;Foo Bar Baz&#39;</div></div><br \
clear="all"><div><br></div><div dir="ltr" class="gmail_signature"><div \
dir="ltr"><div><span \
style="border-collapse:separate"><div>_,,,^..^,,,_<br></div><div><span \
class="gmail_default">Happy Holidays</span>,  \
Eliot</div></span></div></div></div></div></div>


[Attachment #6 (text/plain)]




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic