jed-users mailing list

[2002 Date Index] [2002 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: little problem with xmlmode


On Wed, Apr 17, 2002 at 10:55:21AM +0200, Joachim Schmitz wrote:
> When the javascript contains a "<" like here:
> 
> function changeImages() {
> if (document.images && (preloadFlag == true)) {
> for (var i=0; i < changeImages.arguments.length; i+=2) {
>                  document[changeImages.arguments[i]].src = 
> changeImages.arguments[i+1];
>                  }
>                  }
>                  }
> 
> 
> the indentation gets confused, is there anyway to avoid this ?

Ah, there's a bug involved. '<' followed by whitespace shouldn't
really be considered the start of an element. Does the new version
at <http://www.cs.helsinki.fi/u/jesnellm/software/files/xmlmode.sl>
work better?

If separating the '<' or '>' from the surrounding text is for some
reason impossible, you could use a CDATA segment: 

<html>       
       
<![CDATA[              
  function changeImages() {
  if (document.images && (preloadFlag == true)) {
  for (var i=0; i < changeImages.arguments.length; i+=2) {  
  ]]>                    
                      
  <foo>                             
    bar                            
  </foo>    
</html> 

-- 
Juho Snellman
"C:stä on kehitetty Massachusettsin teknillisessä korkeakoulussa kieli
 nimeltä BCPL."  

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2002 date index] [2002 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]