Now I know you are a man who (as your web site says) loves "reinventing the wheel"...
But I thought I might ask what the advantage is here over just using getascss(text) with a top & tail html/head/body tags ...?
I'm also not sure why you'd do it that way, Ralf. I'm not a fan of GetAsCSS() without some serious tweaking (it's doesn't seem xhtml compliant, for example). But it does what you want (mostly) as is.
Hi Lyndsay and Beverly,
there is indeed no advantage over getascss(text) (thanks for that hint - I hadn't thought of trying it that way).
The reason for me to explore this is that I want to use Filemaker for the maintenance of a dictionary of some sort:
On this website m-tarot.net I make use of a dictionary (open the 'Card Description' accordion tag). To generate the website I use an algorithm to automatically insert span tags when finding a keyword in the 'Card Description' text.
To enable easy maintenance of multiple keywords for the editor I want to use Filemaker in a similiar way: marking a word within a text and showing some dictionary data (when clicked?). I can underline a word (or two or three) when there is a dictionary entry referred to already - and perhaps show it when clicked. And also to allow easy adding of selected word(s) as key for a dicionary entry.
(there is a many-to-one table with the keywords as key).
I think without MiddleValues and GetAsCSS this would be difficult if not impossible. To find these not so obvious thing I need to 'reenvent the wheel' - I learn a lot when I do this.
I admit that converting the entire text - as I did in my sample - can easily bring up the question as to why. Also I hadn't thought of trying to convert the entire text.
Thank you for your interest.
OK! I'd come up with a solution for a client a long time ago. They could select a word or phrase and a script would ask for a link. It would then insert the link into the text as an HTML hyperlink. I did the same thing with bold, underline and other text formatting - adding HTML/CSS to the selection. The "selected" would be the only thing that got changed in the entire text field. Actually, there was a trick, as there were two fields, one "human-readable" and one with the HTML. The HTML fields were used to update a website.
p.s. this was *before* GetAsCSS()...