Wrox Programmer Forums
|
Forum and Wrox.com Feedback Post your suggestions for improving the Forums or Wrox.com or questions for the staff here. "Where can I find the code for my book?"
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
  #11 (permalink)  
Old June 19th, 2003, 01:51 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

Okay, I did some testing.

Pasting in code with tabs really does include the tab character (chr(9)) in the textarea. I was concerned that maybe tabs got converted to spaces which would explain the behavior in HTML (in the forum) and the text emails.

The good news is that I've updated the forums to replace any tab characters with the forum code [t] so that the formatting will be preserved.

You also might wonder how I put the code [t] in my posting without the quotes. There's a new forum code pair [brace][/brace] that will display the left and right braces - without evaluating to forum code.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
  #12 (permalink)  
Old June 19th, 2003, 02:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Bruce,

Before we forget all the forum codes- you might want to make sure you add the new ones to the forum code help page....


Hal Levy
Daddyshome, LLC
NOT a Wiley/Wrox Employee
  #13 (permalink)  
Old June 19th, 2003, 03:27 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by Hal Levy
 Bruce,

Before we forget all the forum codes- you might want to make sure you add the new ones to the forum code help page....


Hal Levy
Daddyshome, LLC
NOT a Wiley/Wrox Employee
Good idea. It's been updated.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
  #14 (permalink)  
Old June 25th, 2003, 11:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In addition to this I was wondering if it would be possible to replace all occurrances of 4 spaces with ["t"]. The reason is that text editors will convert all tabs to spaces. It would be unusual to have 4 spaces in normal text, so that shouldn't be a problem. 4 spaces is the most common tab depth. See this posting for an example:
http://p2p.wrox.com/topic.asp?TOPIC_ID=1021

regards
David Cameron
  #15 (permalink)  
Old June 26th, 2003, 08:00 AM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

David,

In your example, if the poster had put [code][/code] tags around his code, then the formatting would have been retained - even if the tabs were converted to spaces. The loss of formatting (outside of code blocks) occurs because HTML considers multiple spaces redundant.

Rather then change people's posts and preventing a possible intended sequence of spaces, I would recommend that we further try to educate forum members to make better use of the [code][/code] functionality.

BTW - You can include brace characters by using the [brace][/brace] tags.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
  #16 (permalink)  
Old June 26th, 2003, 06:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:
Rather then change people's posts and preventing a possible intended sequence of spaces, I would recommend that we further try to educate forum members to make better use of the functionality.
At the moment an intended sequence of spaces is lost in the website, but not in outgoing emails or in the text box where someone pastes/types his code.

I agree that the [code] tags are the best way to do things, however people coming to the website new are not going to use them. Education takes time and if there is a steady turnover in subscribers then education doesn't work. We don't want a situation where the l33t team knows the best way to do things and blasts any hapless newbie that wanders into the forum and does the wrong thing. Not that this is likely to happen, just that if there is a significant amount of education that needs to take place before people can use the website to its fullest extent the situation is going to be less than ideal. The learning curve should not be too steep.

regards
David Cameron
  #17 (permalink)  
Old June 27th, 2003, 07:39 AM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When the post-by-email system is implemented, I assume people are going to have to remember to surround code blocks with the [code] tags in those if they want indented blocks to appear correctly on the forum, too? If so, you'll have an even harder time of getting email users to remember to put these in when posting, I think. When posting a message via the website you can always remind people either on the same page or via the popup help, but when people are posting by email they aren't used to having to use a proprietary set of tags just to be able to format their post correctly.

Having said that I can't see why replacing four consecutive spaces with a [t] tag would be a problem anywhere, really, though you'd probably want to re-replace the [t] with spaces on outgoing emails to avoid confusion.
  #18 (permalink)  
Old June 27th, 2003, 04:41 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

Okay...

I've made some improvements (hopefully ) to the formatting handling.

Posts should now retain all of the author's intended spaces in both the HTML and text subscription emails. This will occur both inside and outside the [code] tags.

This solution will retain multiple spaces - regardless of the number. To encourage the use of the [t] tags, any occurrences of 4 consecutive spaces will be converted to the tab tags. Occurences of less than 4 will be left as spaces.

For example:

 One character indented
  Two character indented
     Five characters indented (converted to [t] and a space)
This line has embedded spaces that are retained


Try it out and let me know what you think.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
  #19 (permalink)  
Old June 30th, 2003, 06:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much for that.

    I think it looks great.

regards
David Cameron
  #20 (permalink)  
Old July 2nd, 2003, 03:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is the formatting/presentation of these consecutive spaces done when a user submits his/her post, or when the data is pulled from the DB to assemble a page?

It's not a big deal, but it'd be cool if all the existing posts were run through your space-fixer thingamajig.


Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do my posts look strange? joefawcett Forum and Wrox.com Feedback 2 December 16th, 2004 12:04 PM
Where are the archived posts? RaminS Forum and Wrox.com Feedback 3 June 26th, 2003 11:06 AM
Editing Posts chrislepingwell Forum and Wrox.com Feedback 4 June 10th, 2003 10:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.