News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF editor - how does it preserve user-inserted spaces?

Started by jdougher, August 10, 2013, 05:57:30 PM

Previous topic - Next topic

jdougher

Question: How does the SMF editor preserve user-inserted spaces?

I'm not complaining. In fact, my forum PoetryCircle runs on SMF primarily because the editor preserves user-inserted spaces, a feature that is crucial to a poetry forum.

It's just that most of the other forum software on the market includes editors that strip user-inserted spaces before the post is committed.

So what is SMF's secret? I know that SMF is not alone. There are a few other free packages that contain editors that also preserve user-inserted spaces, but the big guns of the forum world--vBulletin, Invision, Xenforo--all contain editors that strip user-inserted spaces.

You talk to the developers of these fora, and they typically say the same thing: That's the behavior of HTML. However, the editor of SMF (and a few others) don't do this. So obviously the "behavior of HTML" excuse is not the whole story.

So what's the secret?

I'm sure I'm not the only who wants to know.

Thanks!

jdougher

In case you need a demonstration of why the preservation of user-inserted can be important, I direct you to these threads:

http://poetrycircle.com/index.php/topic,13943.0.html

http://poetrycircle.com/index.php/topic,12234.0.html

Or let's say you have a poet like Larry Eigner show up on your site, and he posts this poem:

Again dawn

      the sky   dropped
                     its invisible whiteness

                      we saw       pass out
                                                   nowhere

                            empty the blue

                                          stars

                       our  summer
                                           on the ground

                like last night another
                                                  time

                                in fragments

Source: http://writing.upenn.edu/pennsound/x/Eigner.html

In most fora editors, you have to use the "code" tag to preserve such spaces. Not acceptable! Code sucks, and it's not poetic.


MrPhil

The SMF editor preserves spaces by changing every other blank into a non-breaking space &nbsp ;. That prevents HTML from collapsing runs of spaces into single blanks. It's not really part of the "editor" -- SMF just uses a <textarea>. It's in the post-processing of what comes out of the <textarea> that's the difference -- whoever wrote that code decided to preserve extra spaces, apparently figuring that if you put in multiple spaces, that you must have done so for a reason.

Burke ♞ Knight

Some forums, Vanilla, use what's called Markdown. To me, that is very annoying, as you have to put 3 spaces before hitting enter for a line break.

http://en.wikipedia.org/wiki/Markdown

Arantor

Correct, and it has always done that. In fact, I believe that may even have been a hang-over from the YaBB days.

I should note that the other systems don't collapse it, they just do what HTML specifies for the most part, and it's HTML itself that mandates the collapsing.

jdougher

Quote from: MrPhil on August 10, 2013, 06:24:00 PM
whoever wrote that code decided to preserve extra spaces, apparently figuring that if you put in multiple spaces, that you must have done so for a reason.

Hurrah!

Believe me, people are watching this thread, as I posted a link to it on Xenforo.com. I'd prefer to use Xenforo, but as with the other big guns of the forum world, Xenforo employs an editor (or a scheme) that strips user-inserted spaces.

I'm not taking sides here. As the owner of a popular forum of creative artists, I'm really just echoing concerns of users. It's funny: the makers of forum software focus on all of the "extras" that they believe will set them apart. But users, I've found, are focused on the most basic things, such as whether the "editor" preserves the spaces that they insert. I've created test conversions of PoetryCircle to vBulletin, Xenforo, IP.board, you name it: Without an editor that retains user-inserted spaces, it's NO GO for the users.

Facebook "likes" be damned!

;)

Advertisement: