[Po4a-devel] Turning off wrapping for a specific XHTML tag

Kaloian Doganov kaloian at doganov.org
Fri Dec 28 20:49:46 UTC 2007


Kaloian Doganov <kaloian at doganov.org> writes:

    It would be much easier if there was a way to specify this wrap-flag
    individually for a tag, without having to deal with global
    skipping/non-skipping of all mentioned tags.

Also, it will be useful if the wrapping of the <script> tag is turned
off by default in the Xhtml module.  The <script> tag by definition
contains code fragment of a syntax which Po4a does not understand.  The
most widely used language is ECMAScript, of course, and ECMAScript's
syntax almost ignores whitespace, with some notable exceptions.  For
example:

   <script>
   var label1 = "Hello";
   var label2 = "World"; // Please replace with your own messages!
   </script>

Becomes:

   <script>
   var label1 = "Hello"; var label2 = "World"; // Please
   replace with your own messages!
   </script>

which is not a valid ECMAScript code, so the interpreter ignores and the
document is broken.

Also, a <script> tag can contain other languages as well, for example
Python or Basic, where whitespace is even more significiant.  Therefore,
wrapping of such code fragments is not a good idea per se.

-- 
Protect your digital freedom and privacy, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm




More information about the Po4a-devel mailing list