edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Adam Thompson <arthompson1990@gmail.com>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] tidy debug tree, and a js script
Date: Sat, 29 Aug 2015 14:25:16 +0100	[thread overview]
Message-ID: <20150829132516.GD31434@toaster.adamthompson.me.uk> (raw)
In-Reply-To: <20150729060404.eklhad@comcast.net>

[-- Attachment #1: Type: text/plain, Size: 2660 bytes --]

On Sat, Aug 29, 2015 at 06:04:04AM -0400, Karl Dahlke wrote:
> Debug prints are in, and seem to work.
> Thanks Kevin.

Well done all for the work, appologies for being somewhat inactive recently but
I've been busy with the day job and simply haven't had any time to do anything
computing related outside of the office.

> Here is my test page, that I was worried about.
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head><title>jf test </title></head>
> <body>
> hello world
> <script type=text/javascript>
> document.writeln("This is <A href=http://edbrowse.org>our website</A>");
> </script>
> </body></html>
> 
> I browse with db6, there  is lots of js debugging,
> I'll leave that out, here are the relevant lines.
> 
> line 7 column 67: '<' + '/' + letter not allowed here
> Node(0): Text
> Text: hello world 
> Node(0): script
> type = text/javascript
> Node(1): Text
> Text: document.writeln("This is &lt;A href=http://edbrowse.org&gt;our
> website&lt;\/A&gt;");
> #  end of tidy debug output, next stuff is ours
> execute jf at 6
> < side effects
> w{This is <A href=http://edbrowse.org>our website</A>
> `~@}
> < ok
> execution complete
> docwrite 62 bytes
> <<
> This is <A href=http://edbrowse.org>our website</A>
> >>
> anchorSwap 4
> anchors unframed
> whitespace combined
> 
> Right off the bat I'm concerned becausee tidy shows an error
> where there is no error.
> It is trying to interpret the </a> tag in the string, in the script,
> and it shouldn't be doing that at all.

Actually, yes it should. This is one of the corner cases with html;
everything within a script tag is not parsed except the sequence </ which ends the tag.
At least according to what I've read.
If you really don't want your data parsed at all, use a cdata section,
then access that with js (it's parsed into the DOM so this works).
> Next I look at the text node under the script,
> the text that is to be passed to the js engine, and it has been html escaped.
> <a> is now &lt;a&gt;
> Why?
> That would totally screw things up.
> Is it escaped and interpreted for the benefit of printing, for us,
> or is it done by cleanup?
> If the latter then we can't use tidy5 unless this is fixed.
> This is a show stopper.
> They can't be mucking with the contents of a js script at all.
> In fact they shouldn't muck with the contents of any script.

Actually, see above for how script tags should behave. I think it's actually our current parser which is slightly broken.
Not sure about the escaping part though.

Cheers,
Adam.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-08-29 13:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29 10:04 Karl Dahlke
2015-08-29 13:25 ` Adam Thompson [this message]
2015-08-29 14:36   ` Karl Dahlke
2015-08-29 14:58     ` Adam Thompson
2015-08-29 16:05       ` Karl Dahlke
2015-08-30  1:15         ` Kevin Carhart
2015-08-30  8:26         ` Adam Thompson
2015-08-30  9:30           ` Adam Thompson
2015-08-30  9:49             ` Karl Dahlke
2015-08-30 10:02               ` Adam Thompson
2015-08-30 10:31                 ` Karl Dahlke
2015-08-30 11:16                   ` Adam Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150829132516.GD31434@toaster.adamthompson.me.uk \
    --to=arthompson1990@gmail.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).