0

As title; unless there's already a way:

<html>
<head>
<script type="text/javascript">
function myfunction( )
{
  alert( "Hello, World!");
}
</script>
</head>
<body>
<p>Some HTML code</p>
<img onclick="myfunction( );" src="some_image.gif"/>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function myfunction( )
{
  alert( "Hello, World!");
}
</script>
</head>
<body>
<p>Some HTML code</p>
<img onclick="myfunction( );" src="some_image.gif"/>
</body>
</html>

Not a major problem, I know, This example doesn't show the problem well, but when posting loads of HTML, with loads of Javascript in the same block; I find myself having to 'pick' between one or other inperfect formats.. HTML+Javascript could highlight both..

On another note.. there's a style leak in the HTML formatter:

<a href="

My signature will be blue! That's a minor, almost insignificant, problem though.

EDIT: Ah, it seems to spill further than my signature..!

4
Contributors
18
Replies
19
Views
9 Years
Discussion Span
Last Post by MidiMagic
0

I'm not sure what you typed to get the "leak". I think it must've parsed itself or something.

0

If you open an HTML element attribute and forget to close it within an HTML code block; then the 'blue' style continues into the rest of the post, and, if your thread view is linear > oldest first ( mine is usually linear > newest first ), the blue spreads into other peoples posts aswell; and then it goes on into the rest of the daniweb interface. I think it's the same with C++ strings:

std::string hello( "hi
0

On original topic; what are your thoughts on an HTML+Javascript syntax highlighting mode?

0

If you open an HTML element attribute and forget to close it within an HTML code block; then the 'blue' style continues into the rest of the post, and, if your thread view is linear > oldest first ( mine is usually linear > newest first ), the blue spreads into other peoples posts aswell; and then it goes on into the rest of the daniweb interface. I think it's the same with C++ strings:

std::string hello( "hi

I am not able to reproduce this. :(

1

Ah... it's not doing it on Firefox, only Opera.. strange :|

Hm.. the code for this page looks wierd here though:

<div class="de1">[B]<span class="st0"</span>[/B]</div></li></ol></pre>

and here:

&lt;a</span> <span class="kw3">href</span>=<span class="st0">&quot;</span></div></li><li class="li1"><div class="de1"><span class="st0">[B]</span</span>[/B]</div

Assuming that's autogenerated by the syntax highlighter; I would assert that that's where it goes wrong, and that Opera and FF have different ways of dealing with the glitch.

0

I've been working on the problem today. The problem is definitely a bug with the syntax highlighter, and it looks as if the author has provided a workaround as this bug was previously reported. Still working on it.

0

Here it is. Look at the code area. The line numbers are overlapping.

I have Firefox 2.0.0.6 on Windows XP, resolution 1152 X 864.

Attachments numover.jpg 48 KB
0

In Opera, I only see a single line ( and single line number ) in my posted codeblock..

But, there's a superfluous <li> in the HTML close to the screwy '</span</span>' part.. So, there should really be another line number shown.

In Firefox 2, I see the same as MidiMagic, a pair of line numbers, with one over the other; but ONLY in this (unfinished quote) case and normally they are absolutely fine.

The browsers are dealing with the bad bit of data differently, which is unsuprising really, since 'correct' behaviour isn't defined. Opera hides the next <li> and spills blue from the unclosed quote to the end of the Daniweb page, Firefox squashes the next <li> and continues as per usual.

I thought there'd be quite a simple explanation, like the parser starting a blue span and not closing it.. that's what it looks like in Opera. Personally, I wouldn't rank this problem as 'high priority' if you're having trouble nailing it down.. It doesn't seem to be exploitable.

0

Oh I forgot to mention, I fixed the problem (I think) yesterday but it only applies to new posts. Testing testing ...

<a href="
std::string hello( "hi
0

It blued out for me again, see attached. My post wasn't showing blue until you started it all over again =P.

Attachments Screenshot-Propose_HTML_+_Javascript_code_formatting_-_DaniWeb_Community_Feedback_-_Opera.png 203.58 KB
0

Oh I forgot to mention, I fixed the problem (I think) yesterday but it only applies to new posts. Testing testing ...

<a href="
std::string hello( "hi

It did it only on the last two lines, and then only if the last line was empty.

These are OK.

0

It blued out for me again, see attached. My post wasn't showing blue until you started it all over again =P.

I haven't seen this blue at all in Firefox.

Something is bloo-ey.

Since it involves busted span tags, maybe we should call this bloo problem "span spam."
:icon_mrgreen:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.