Dear Wolfgang,

After Maksym Zinchenko, we found as well a problem with the modified ADP parser (inside an embedded minified JavaScript code)

The situation is more tricky than expected, since we have
- a language mix in ADP files (Tcl, HTML, JavaScript) and special ADP tags and semantics
- Some of these problems are addressed by HTML, which treats <script>
   context as CDATA (e.g. tags inside JavaScript)

     <script 
type="text/javascript">document.write("<script>alert('Hi')</script>");</script>
     <script type="text/javascript">x = '<br>';</script>

  In addition, ADP allows as well inline code blocks

    <script type="text/javascript"> x= '<%= [expr {2 + 2}] %>';</script>

 such that CDATA is not sufficient. Some of the <script>s can be executed on the client side, some on the server side (runat=server), and ADP also supports tag substitutions in tag definitions as well

  <html<if @doc.lang@ not nil> lang="@doc.lang;literal@"</if>>
  <script type="@type@"<if @src@ not nil> src="@src@"</if>><if @content@ not 
nil>@content@</if></script>

These are examples from OpenACS, which as an <if> tag defined and has also special substitution rules. The usage of ADP tags inside the starting HTML tags is not really documented, but used all over.

The semantics of the ADP parser are quite complex to handle these situations in some meaningful way, and i would not be surprised, if some rough edges limit full orthogonality would pop up. However, the version committed today addresses all known issues, and has a substantially extended regression test. It required some refactoring of the ADP parser. The performance should be slightly faster than the classical parser.

Please test if possible,

-g

_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to