Home
About
Agents
CGIs
Mac
Macros
Misc
Stories
Suites
Websites
Outline
Frontier
Scripting

Filtering Text

On the Frontier-newbies list, David Grenier, dgrenier@wheatonma.edu, says: "I'd like to build a filter that changes hard returns in my WP file to actual <BR> tags when the page is rendered."

David's site

I put together a site that shows how to do that. It's baked into this page.

After loading the site into your database, open websites.davidSite.default. You'll see several state names, each on its own line.

Now publish the page. It should look like this.

Now open...

websites.davidSite.["#filters"].pageFilter

Here's what you'll see:

on pageFilter (adrPageTable)
adrPageTable^.bodytext = string.replaceAll (adrPageTable^.bodytext, "\r", "<BR>\r")
html.addPageToGlossary (adrPageTable)
return (true)

This is where the <BR> tags are added.

Here's what string.replaceAll does.

Dave Winer
3/2/98


This is a fat web page containing websites.davidSite. More info on fat pages here.

© copyright 1997-98 UserLand Software. This page was originally posted on 3/2/98; 8:04:38 AM and it was last built on 9/11/98; 9:23:50 AM. Webmaster: dave@userland.com.