Home
Q&A
Putting an indent of 4 or more spaces activates < pre > tag

Putting an indent of 4 or more spaces activates < pre > tag

2
votes

Whenever a poster adds a 4 or more spaces to indent to a paragraph, the following text (up until the next new-line character) will be surrounded the < pre > tags. This can cause viewing problems as typically the text stretches horizontally off the page. View page source and look at the next few paragraphs. You will find that the one that starts of "Four spaces preced this paragraph..." is surrounded by < pre > tags.

No spaces precede this sentence. I am formatted properly. A new-line character follows this sentence.

One space precedes this sentence. I am formatted properly. A new-line character follows this sentence.

Two spaces precede this sentence. I am formatted properly. A new-line character follows this sentence.

Three spaces precede this sentence. I am formatted properly. A new-line character follows this sentence.

Four spaces precede this sentence. I stretch horizontally outside the boundaries of the normal text area. If you view page source, you will find < pre > tags before and after this paragraph. A new-line character follows this sentence.

As long as I don't indent by 4 or more spaces, the next paragraph returns to normal formatting.

You may decide to leave this in as a feature, I don't know. I just wanted to make sure you were aware of it.

Of course, it can be handy. Inside <pre> tags,
one can safely include certain html tags like <img>
or similar code without fear of them being processed.
Plus, new lines will be processed according to my

dictates, be that
one line,

two,


or more.
 And, I can make
    indents, too.

My concern is that the pre tag is activated without the post's author realizing it (by including 4 or more spaces in front of a sentence). So many times, I see sentences running off the page like in my example and I have go correct it by deleting the spaces.

I think it's great to be able to include the < pre > tag on purpose, however. I just think its automatic activation by preceding a sentence by 4 or more spaces should be turned off. My two cents.

3151 views
updated MAR 4, 2010
edited by webdunce
posted by webdunce
Oops! I didn't mean to store that edit view. - 0074b507, MAR 3, 2010
No problem. I know you were just seeing what I typed, plus a later edit removed any trace of it. :) - webdunce, MAR 3, 2010

1 Answer

1
vote

¡Hola!

Very good observation!

What you can do is to put < pre > then put in the text, then put < / pre > to close the tag.

You do not have to go down 4 lines, you can do it anywhere.

Of course all of the above tags have no spaces. If I put spaces, you would not see them.

By doing this you can indent.

for example:

 this is how            to          indent 

and now back to regular mode, which will follow aver the < / pre >.

I am sure there are other things also.

updated MAR 3, 2010
posted by Rolest
I didn't know they allowed the pre tag outright like that. Cool. But I'm concerned because preceding a sentence with 4 spaces turns it on unintentionally, which causes peoples' sentences to run off the page frequently. - webdunce, MAR 3, 2010
If you're curious, its there to format code on computer sites - crazyjugglerdrummer, MAR 3, 2010
SpanishDict is the world's most popular Spanish-English dictionary, translation, and learning website.