Forum OpenACS Q&A: Scan uploaded .html for images/links?

Dear List,

For the most part, Blackboard annoys me.  However, one feature they
have that I think is cool is useful is that when a user uploads an
html file, it is scanned for relative links.  Anything that is going
to be broken by its new location generates a screen prompting you to
upload the appropriate file or (I think) modify the link.  This is a
pretty spiffy feature.  If you wanted to upload a page that has an
image in it somewhere, you upload the page and are prompted to upload
the image on the next screen.  This isn't amazing functionality to
anyone with any html experience at all, but it is useful for someone
who has just recently discovered the "save as HTML" option in their
word-processor.

So here's the question:  Does this functionality exist in openACS
somewhere already?  (I'm using 3.2.5.)  Or if you've implemented it,
would you consider sharing?  Otherwise, I'll slap something together,
and can release it if anyone is interested.

Collapse
Posted by Don Baccus on
I don't know of anyone having done this before, though of course someone may've quietly done so for a particular site implementation.

It is interesting.  You may want to look at the text-html-procs.tcl file included in OpenACS 4.5's acs-tcl package.  It has code to look for unclosed links and other errors that's used to protect against broken HTML in forum posts, etc.  It might be wise to run user-submitted HTML through the checking proc in text-html-procs.tcl before putting it up on a site ...

Collapse
Posted by Don Baccus on
Hmmm...and you could actually just modify the proc to check for relative links as it essentially is parsing the submitted HTML...
Collapse
Posted by Cathy Sarisky on
Thanks Don,

I'll take a look at this...