Ticket #4544 defect new

Opened 3 years ago

Last modified 18 months ago

Lore applies quoting to contents of script tags

Reported by: jml Owned by: khorn
Priority: normal Milestone:
Component: lore Keywords:
Cc: thijs Branch:
Author: Launchpad Bug:

Description (last modified by thijs) (diff)

Lore applies quoting to the contents of script tags, which makes scripts buggy and not work.

e.g. Save this file as /tmp/lore/lore-quote-js.xhtml

<html>
  <head><title>Hello</title></head>
  <body>
    <h1>Hello</h1>
    <script type="text/javascript">
      alert("Hello world!");
    </script>
  </body>
</html>
  • Copy doc/core/howto/template.tpl from Twisted into /tmp/lore/.
  • cd /tmp/lore
  • lore -d .

The contents of the generated javascript in lore-quote-js.html look like:

alert(&quot;Hello world!&quot;);

instead of:

alert("Hello world!");

You ought to be able to open /tmp/lore/lore-quote-js.html in your browser and see an alert dialog box pop up with "Hello world!".

Change History

1

Changed 3 years ago by jknight

It looks like it works if you instead do: <script type="text/javascript"> //<![CDATA[

alert("Hello world!");

//]]> </script>

which is what you're supposed to do in an xhtml document. Recommend resolving as invalid.

2

Changed 3 years ago by jknight

Argh, didn't quote it right for trac.

<script type="text/javascript">
//<![CDATA[
      alert("Hello world!");
//]]>
</script>

3

Changed 3 years ago by exarkun

Hm, does it? I tried this, and lore produced this output:

    <script type="text/javascript" xml:space="preserve">
    //
      alert(&quot;Hello world!&quot;);
    //
    </script>

which looks about equally broken to me.

4

Changed 3 years ago by jknight

Hrmf. :( I had inadvertently run the test on the system copy of lore by accident, which is version 8.2.0. My checkout directory wasn't named "Twisted" so the automagic PYTHONPATH-setting didn't work. :(

Anyways, it used to produce this output:

<script type="text/javascript">
//<![CDATA[
      alert("Hello world!");
//]]></script>

That changed in r26264. So, neeeevermind the suggested fix, then.

5

Changed 3 years ago by exarkun

Damnit. :(

6

Changed 3 years ago by exarkun

  • owner changed from spiv to khorn

7

Changed 3 years ago by exarkun

  • description modified (diff)

8

Changed 19 months ago by thijs

  • cc thijs added

Single-quotes seem to work, also see #5380.

9

Changed 18 months ago by thijs

  • description modified (diff)
  • milestone regular-releases deleted

This no longer affects the ReleaseProcess (#5380).

Note: See TracTickets for help on using tickets.