Sorry this took so long to respond to, have been extremely busy with
assignments over the past few weeks.

I've been trying to implement a simple parser that when it encounters (for
now just any [br]) a tag it does the appropriate action:

294 fun parse2(text) server{
295   if (length(text)>1){
296     var head = hd(text);
297     if(head=='['){
298       <#>
299       <br />
300         <#>
301         {stringToXml([hd(text)])}</#><#>
302         {parse2(tl(text))}
303       </#>
304       </#>
305     } else {
306       <#>
307       {stringToXml([hd(text)])}
308       {parse2(tl(text))}
309       </#>
310     }
311   } else {
312     <#>{stringToXml(text)}</#>
313   }
314 }


I'm wondering why this with input "This is some [br] text" returns:

T h i s i s s o m e
< b r / > t e x t

it seems to have gotten rid of all the actual spaces but also placed spaces
in between every character? Is this a known side-effect of placing two xml
outputting links code next to eachother?

Been a while since I worked in Links so I honestly can't remember what kind
> of String manipulation / searching functions are available, but perhaps
> this might be a valid approach. Can see this being an issue with any kind of
> complex CMS system or any input forms that use rich content editors like
> TinyMCE.
>

It is for a CMS type situation, but in the end it might make more sense to
have one of these implemented in Links anyway that lets users perform 'safe'
xml code that then returns error messages or fixes it?

> As we don't currently support XHTML validation, we could quite easily
> implement a way of serialising XML for storage in a database field.
>
> Do you mean that data could be retrieved from a database as XML as opposed
to a String?

-Simon
_______________________________________________
links-users mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/links-users

Reply via email to