Bit by our own list...here it is in plain text!

-Bo

--Striptags--

REBOL [
    Title:  "HTML Tag Stripper"
    Date:   20-Jul-1999
    Author: "Bohdan Lechnowsky"
    Email:  [EMAIL PROTECTED]
    Purpose: {
        To strip off HTML tags leaving only text behind
    }
]

striptags: func [page /local text end] [

    multi-replace: func [
        {Replaces multiple items in a file}
        pg  [series!] {The series to replace items in}
        blk [block!] {A block of search and replace elements}
    ][foreach [srch rplc] blk [replace/all pg srch rplc]]

    ;table of tags and more suitable ASCII characters
    page: multi-replace trim/lines page [
        "<TITLE>"    "TITLE: "
        "</TITLE>"   "
"
        "  "         " "
        "<TD>"       "  |       "
        "</TD>"      "  |       "
        "       |               |       " "     |       "
        "<TR>"       " "
        "</TR>"      "
"
        "<TABLE"    "
<"
        "</TABLE>"   "
"
        "<P>"        "
"
        "<LI>"       "
        � "
        "<BR>"       "
"
        "&nbsp;"     " "
        "&gt;"       ">"
        "&lt;"       "<"
        "&copy;"     "(c)"
        "&amp;"      "&"
        "&quot;"     {"}
        "</H1>"      "
"
        "</H2>"      "
"
        "</H3>"      "
"
        "</H4>"      "
"
        "</H5>"      "
"
        "</H6>"      "
"
        "<HR"        "
----------
<"
    ]
    text: copy ""

    append page "<"
    append text copy/part page find page "<"
    while [page: find/tail page ">"] [
        if (first page) <> #"<" [
            if found? end: find page "<" [
                append text copy/part page end
            ]
        ]
    ]
    return append text "
"
]

--End Striptags--

On 10-Nov-2000/10:19:20-7:00, [EMAIL PROTECTED] wrote:
>Graham,
>
>Here is one I hacked together over a year ago.  It tries to keep some of 
>the formatting features of the HTML, but only on a very basic level.
>
>EXAMPLE USAGE:
>    text: striptags read http://www.rebol.com
>
>Have fun!
>
>-Bo
>
>On 9-Nov-2000/21:23:39, [EMAIL PROTECTED] wrote:
>>someone told me next quarter...but I think he was joking! BTW, next assignment is 
>up...
>>
>>rishi
>>
>>Previously, you (Graham Chiu) wrote:
>>> Has anyone got a function that strips out all the html from
>>> a page leaving just the text behind?
>>> 
>>> --
>>> Graham Chiu
>>> -- 
>>> To unsubscribe from this list, please send an email to
>>> [EMAIL PROTECTED] with "unsubscribe" in the 
>>> subject, without the quotes.
>>> 
>>> 
>>
>>-- 
>>To unsubscribe from this list, please send an email to
>>[EMAIL PROTECTED] with "unsubscribe" in the 
>>subject, without the quotes.
>>
>-- 
>                           Bohdan "Bo" Lechnowsky
>                           REBOL  Adventure Guide
>           REBOL Technologies 707-467-8000 (http://www.rebol.com)
>       The Official Source for REBOL Books (http://www.REBOLpress.com)
>
>
>-- Binary/unsupported file stripped by Listar --
>-- Type: application/octet-stream
>-- File: striptags.r
>
>
>-- 
>To unsubscribe from this list, please send an email to
>[EMAIL PROTECTED] with "unsubscribe" in the 
>subject, without the quotes.
>
-- 
                           Bohdan "Bo" Lechnowsky
                           REBOL  Adventure Guide
           REBOL Technologies 707-467-8000 (http://www.rebol.com)
       The Official Source for REBOL Books (http://www.REBOLpress.com)

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to