[links-list] Re: Cookies

Khimenko Victor khim at sch57.msk.ru
Fri May 3 23:26:09 PDT 2002

On Sat, 4 May 2002, Jonas Fonseca wrote:

> On Sat, May 04, 2002 at 12:02:19AM +0200, Witold Filipczyk wrote:
> > Workaround:
> > In elinks-hooks.lua in pre_format_html_hook
> > add two lines:
> > html = gsub (html, "<script>.-</script>", "", 1)
> > ret = 1
> I really must get this lua up and running soon then. The debian
> package has gone from recommending it to depend on it.
> Must be a sign. :)
> Is this hook able to handle this piece of (I think) legal javascript
> code as well ?

You think wrong. While it's legal javascript it's illegal HTML with
JavaScript :-)

> <p> script test start </p>
> <script>
>         if(a_string == '</script>') this_should_be_ignored();
> </script>
> <p> script test end </p>

It's not legal usage of JavaScript - you need to do something like this

	if (a_string == ('<'+'/script>') this_should_be_ignored();

Most browsers (even where JavaScript is supported) will FIRST cut part of
HTML from <script> to </script> and THEN try to interpret it. It's
explained in all good manuals about JavaScript and both MS IE and Netscape
will interpret as JavaScript only part from <script> to quoted </script>
and the reas you'll see in browser window...

> The long term solution must be for the skip function to have either
> a state variable so it knows when it's dealing with a string or a
> help function that skips until next ' or " character is met
> depending on which of these started the string. Oh yes and it should
> handle escape characters as well. And also possibly ... ;)

Well - we can be glad Netscape and followers put this burden on
web-masters and not on web-browsers ...

Unsubscribe: send email to links-list-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message

More information about the links-list mailing list