Author |
Topic |
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2002-03-24 : 08:00:54
|
I've made a code change that should allow you to copy and paste from the forums into Query Analyzer with carriage returns intact.===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-03-25 : 04:27:19
|
Excellent! I see that [code] doesn't hide single blank lines anymore either. |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-03-25 : 08:50:10
|
Text immediately following code tag may fail to wrap now. Example:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=14218Looking at the source, it's generating stuff like this:<BR>I need a query that would be able to give the following results:<BR><PRE id=code><font face=courier size=2 id=code><BR>Pos. Competitor Total<BR>1 2 15<BR>2 3 8<BR>3 1 5<BR></font id=code></pre id=code><BR>An added bonus would be the ability to consider the next [...]<BR> -The </font> and </pre> close tags have attributes -- close tags do not have attributes. An attribute value of code or courier without quotes is not legal. The <PRE> may or may not match </pre> depending on whether the code is treated as XML -- it would be safest to make them both lowercase.Edited by - Arnold Fribble on 03/25/2002 08:55:29 |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2002-03-25 : 11:46:46
|
Yuck! Fortunately I think the fix is pretty easy for this. I'll take a look at it tonight.===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
|
|
Doug G
Constraint Violating Yak Guru
331 Posts |
Posted - 2002-03-25 : 17:49:33
|
The <pre> and <font> tags were there before the change, btw.======Doug G====== |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-03-25 : 18:52:41
|
Graz, you seem to have changed it since I last looked, but it's still not wrapping the line immediately following a code section (in ie5.5 anyway).I tried stripping down a forum page to see where it starts breaking and bizarrely, it seem to be the trailing <BR> before the </PRE> that makes the difference -- looks like a browser bug to me!Taking that out makes it wrap (although having two <BR>s after the </PRE> makes the gap after pretty big. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-25 : 18:59:35
|
That's actually a function of HTML rendering, using the default behavior. Outside of a <pre> tag, a CR-LF is treated as white space and is collapsed/ignored. Inside a <pre> tag though, a CR-LF is treated as a <BR>. |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2002-03-25 : 22:09:49
|
Ok, I'm confused. Do I or don't I need to make a change? I can add a <P> after the </PRE> tag is needed.===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-03-26 : 04:12:40
|
Rob, it's not a function of HTML for <BR>s within a <PRE> element to affect the layout of the text outside the <PRE>! However, this is exactly what happens on ie5.5.In contrast, Netscape 6.2 doesn't do this... but it does render <BR> within <PRE> as an extra line space, resulting in the code sections being double spaced.As I said, I reckon removing the trailing <BR>s in the <PRE> elements generated by code should fix the problem for ie5.5 -- I suppose that's a bit tricky since you don't know if they're trailing until you get to the end of the code section. However, I don't really see the necessity of any <BR>s within <PRE> elements -- removing all of them results in something the looks ok, copies ok and doesn't mess up in Netscape 6! But maybe there are other browsers where this does cause problems?Edited by - Arnold Fribble on 03/26/2002 04:27:41 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-26 : 08:13:51
|
I've definitely seen problems with this in different browsers. For instance, I'll bet it's not a problem in IE 4 or even IE 5.0. And I know M$ did something with CSS in IE6 that completely FUBAR'd certain pages; they even created a special style setting to use the old behavior! (don't you love it when they insist on changing something they KNOW will cause a problem???)I think the real issue is what happens in the clipboard. Try selecting from the example and pasting it into Word, then turn on the codes! Then do a Paste Special...Unformatted text:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=14218quote: Rob, it's not a function of HTML for <BR>s within a <PRE> element to affect the layout of the text outside the <PRE>!
I never said <BR>'s within a <PRE> tag were the problem, it's the invisible CR-LF that's the issue. The Snitz code converts ALL CR, LF, and newlines into <BR> tags (keeps the Unix LF-only crowd happy). Also, <PRE> is a block-level element, so HTML will render a newline character before and after it anyway...that's why you'll never see text adjacent to a <pre> or </pre> tag. This also gets changed by the Snitz code into a <BR>.If the CR-LF was NOT converted to a <BR>, then I think it would work fine; it would appear correctly inside a <PRE>, and would be collapsed properly outside of a <PRE>.Edited by - robvolk on 03/26/2002 08:28:03 |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-03-26 : 09:34:52
|
Sorry Rob. You've got me completely confused now. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-26 : 11:14:13
|
Yeah, that was a masterpiece of bullshit! Sorry. This will sound redundant, but hopefully will be clearer.I think you'll need to do this in your own HTML page, because the Snitz code will process out the CR-LF's. You should be able to copy and paste the following (remove the <CRLF> codes, but make sure there's a hard return/newline in your HTML where they appear):Hello <CRLF>Arnold <br><pre>How <CRLF>are (there should be no blank lines between this and "you")<br><CRLF>you</pre>today?<CRLF>That's good (this should be on a separate line from "today?" but it isn't)<BR>This WILL be on a separate lineYou'll notice that a CRLF inside a <PRE> tag ACTS as a <BR>, (notice the blank line between "How" and "are"?) Outside of the <PRE>, a CRLF is collapsed as white space (notice how "Hello Arnold" appears on 1 line?) The Snitz code removes ALL CRLF's and replaces them with <BR>, and <BR> always starts a new line either in or out of a <PRE> tag. This is a good thing, except when you have a <BR><CRLF> outside of a <PRE> tag; it will change it into <BR><BR>. Normal HTML processing would just collapse the <CRLF> and would effectively leave you with a single <BR>.Now, as a further wrinkle, a </PRE> tag will render with a new line after it, even if you don't include a CRLF or <BR> in your source. It's a block level tag, not an inline tag (notice how "today?" appears on the same line in the source, but on separate lines in the browser?) However, this phantom newline is a true phantom, it's not included in the actual source, and the clipboard does not create it.Try the example and see if it makes more sense than this. Look at the code, look at the HTML render, and copy and paste it into QA, and look at the differences. Add CRLF's and watch how they collapse (or not), and add <BR>'s too and see what happens.Edited by - robvolk on 03/26/2002 11:15:48 |
|
|
Jay99
468 Posts |
Posted - 2002-03-26 : 11:18:09
|
Why is this post of mine screwed up? Is this related? Does anyone see it funny?Jay<O> |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-26 : 11:20:43
|
Just fixed it. Those damn code tags! |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-03-26 : 15:55:41
|
What I was pointing out was the difference between this:<html><head><title>Title</title></head><body><br>Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1<br>Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1<br><pre><br>Pre 1 Pre 1 Pre 1 Pre 1 Pre 1 Pre 1<br>Pre 2 Pre 2 Pre 2 Pre 2 Pre 2 Pre 2<br></pre><br>Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3<br>Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4</body></html> Which (incorrectly) fails to wrap the "Body 3" text in ie 5.5, and this:<html><head><title>Title</title></head><body><br>Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1<br>Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1<br><pre><br>Pre 1 Pre 1 Pre 1 Pre 1 Pre 1 Pre 1<br>Pre 2 Pre 2 Pre 2 Pre 2 Pre 2 Pre 2<br></pre><br>Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3<br>Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4</body></html> Where Body 3 does get wrapped correctly.However, in NS6 / Mozilla the <pre> part gets double-spaced. Dropping the <br>s within the <pre> like this would work, but the gaps on either side are rather uneven:<html><head><title>Title</title></head><body><br>Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1<br>Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1 Body 1<br><pre>Pre 1 Pre 1 Pre 1 Pre 1 Pre 1 Pre 1Pre 2 Pre 2 Pre 2 Pre 2 Pre 2 Pre 2</pre><br>Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3 Body 3<br>Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4 Body 4</body></html> and if that looks right as an article it will be a miracle! |
|
|
|