 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Forum and Wrox.com Feedback section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

June 19th, 2009, 04:00 PM
|
 |
Wrox Staff
Points: 18,059, Level: 58 |
|
|
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
|
|
Testing a p2p.wrox.com forums whitespace fix
As many of you know, when we migrated the forums we launched with what we knew to be a flaw in how the new platform (vbulletin) handles whitespace: basically that when vbulletin is configured to only allow bbcode ([b], [url], etc) and not real HTML, it squashes extra white space outside of [code] or [pre] elements which means that the beautiful code indenting from your IDE gets killed.
We also had an issue that from some browsers, copying code posts from the site back to your editor lost the spacing.
While we still want to encourage everyone to use the [code] tag for code in new posts, we know it won't happen for 100% of users. So here's what we're working on: - The old posts from prior to the relaunch still have the space characters preserved in the data, we've found a way to replace the real space with a bbcode that vbulletin will present as space
- For the posts from last December to when we implement this fix, the space padding is gone. vbulletin strips that out as junk before it gets saved to the database so those won't be fixed
- We're going to try to implement the space padding replacement on the fly for new posts once we make the fix, converting the leading spaces between when you click submit and when vbulletin saves them.
Here's what we've tested to date (on the QA site): - we converted all the leading spaces to the new code
- We viewed posts in IE8, FireFox 3, Chrome and they spacing looked readable
- We tested replies with quotes of indented code posts IE8, FireFox 3, Chrome and the indenting is preserved in replies
- We pasted these indented code posts from all 3 of the tested browsers to editors and the spacing is preserved
- We have not yet tested but will on IE 6/7 and Safari
So, are there any other remaining problems related to code indenting on the forums that I haven't mentioned that we still need to test for? Any other usage issues you're having specifically on code indenting I don't seem to have covered?
Thanks for your patience.
__________________
Jim Minatel
Associate Publisher, WROX - A Wiley Brand
Did someone here help you? Click  on their post!
|

June 20th, 2009, 05:44 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Jim,
Does this also include the lost spaces in color coded code in code blocks? When you copy from Visual Studio, paste in the editor and wrap it in a code block, all spaces are lost; not just the indenting. This not only makes the code illegible, but also corrupts it. For example, the following code is messed up:
Code:
<asp:LoginID="Login1"runat="server"CssClass="SomeClass"CreateUserUrl="SomePage.aspx">
<LoginButtonStyleBackColor="Green"/>
</asp:Login>
Removing the color coding using the "Remove Text Formatting" button fixes the problem:
Code:
<asp:Login ID="Login1" runat="server" CssClass="SomeClass" CreateUserUrl="SomePage.aspx">
<LoginButtonStyle BackColor="Green" />
</asp:Login>
Notice how the first block has no spaces between the various attributes and values.
Is this being fixed and tested as well?
Imar
|

July 6th, 2009, 01:09 PM
|
 |
Wrox Staff
Points: 18,059, Level: 58 |
|
|
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
|
|
No, the fix we're working doesn't address that. Wow. That's really bad. And I think the first time I've seen it.
Can you give me quick specs on VS version and browser used for this cut and paste?
__________________
Jim Minatel
Associate Publisher, WROX - A Wiley Brand
Did someone here help you? Click  on their post!
|

July 6th, 2009, 03:02 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I've seen it before....
http://www.google.com/search?hl=en&q...r&aq=f&oq=&aqi=
I can reproduce it with Visual Studio 2008 and IE 8 but I think I've also seen it with Express editions and IE7. I think it's also a problem with VS 2010, but I am not sure. Copying it from VS 2010 running in a Virtual PC seems to remove the color so the code gets formatted correctly.
It's easy to reproduce. Just copy some code from VS, paste it in a reply window and hit Preview Post. All code is then messed up. If you use Code tags the code stays OK.
Imar
|

July 14th, 2009, 02:42 PM
|
 |
Wrox Staff
Points: 18,059, Level: 58 |
|
|
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
|
|
Imar: I think I've isolated it a little further. It works OK in Firefox and Chrome, not IE (call me lazy, I haven't tested in Safari!).
But, if in the 3 choices of editor types in the forum profile, you change to "Standard Editor - Extra Formatting Controls" instead of the current default "Enhanced Interface - Full WYSIWYG" you get the following from a straight paste to IE7 without going through the interim code cleaning step:
Code:
<asp:Login ID="Login1" runat="server" CssClass="SomeClass" CreateUserUrl="SomePage.aspx">
<LoginButtonStyle BackColor="Green" />
</asp:Login>
If it seems like this is a problem for a lot of new users, I can change the default editor interface for new people signing up for the forums starting as of now to Standard Editor - Extra Formatting Controls. What do you think?
__________________
Jim Minatel
Associate Publisher, WROX - A Wiley Brand
Did someone here help you? Click  on their post!
|

July 15th, 2009, 03:23 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
As an alternative to fixing the problem at its root (which I understand may not be easy to do), this is probably a good work around, This way it's more likely we'll see well formatted code here.....
Imar
|

July 15th, 2009, 09:33 AM
|
 |
Wrox Staff
Points: 18,059, Level: 58 |
|
|
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
|
|
Yeah, unfortunately rewriting that much of the guts of vBulletin is just way out of scope for us on this. I think the real roots on this were not enough testing early on (not enough test variety from different sources, into different browsers, with all the different editor types selected) to identify all the different code pasting fidelity issues and also underestimating the severity of the code fidelity issue we did see and thinking early on that the fix was always just a couple of lines of code away.
But for now, I've reset the preferences to the more basic editor for new users. You do lose some of the new editor features (wysiwyg) if you make this change. I think the better solution for most people is to use FireFox.
__________________
Jim Minatel
Associate Publisher, WROX - A Wiley Brand
Did someone here help you? Click  on their post!
|
|
 |