Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-08 20:58:49

Riyonuk
New Member
Registered: 2008-05-08
Posts: 9

HTML Indention issues

When a paragraph is generated, it’s usually indented within the source code, can I turn this off somehow? I’m OCD with my source code. Also, TXP seems to add a new line when I don’t want one :P

Offline

#2 2008-05-08 23:22:53

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: HTML Indention issues

Riyonuk wrote:

When a paragraph is generated, it’s usually indented within the source code, can I turn this off somehow?

If you’re talking about source code as viewed in your browser: not by prefs.

Also, TXP seems to add a new line when I don’t want one :P

In which situation exactly?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2008-05-08 23:25:09

Riyonuk
New Member
Registered: 2008-05-08
Posts: 9

Re: HTML Indention issues

Yeah, I’m talking about when I go to View > Page Source within Firefox, all the <p> tags are indented.

Offline

#4 2008-05-09 00:54:32

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: HTML Indention issues

What means OCD?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2008-05-09 01:03:26

Riyonuk
New Member
Registered: 2008-05-08
Posts: 9

Re: HTML Indention issues

Obsessive Compulsive Disorder, I mean, I don’t really have that disorder, I just like things perfect. I like things straight. Get it? :D

Offline

#6 2008-05-09 01:06:34

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: HTML Indention issues

Maybe we should add another “C,” as in “Obsessive-Compulsive Code Disorder.” I think I suffer from the same affliction and, as with Riyonuk, I like all my code to neatly indent with everything in its place. As much as I might want this to be the case I don’t think it’s possible for TXP and the various plugins I use to recognize my indents and follow along. Oh well.

Offline

#7 2008-05-09 05:13:40

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: HTML Indention issues

Riyonuk wrote:

When a paragraph is generated, it’s usually indented within the source code, can I turn this off somehow?

No.

Offline

#8 2008-05-09 14:03:54

Riyonuk
New Member
Registered: 2008-05-08
Posts: 9

Re: HTML Indention issues

Why not?

Offline

#9 2008-05-09 14:13:03

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: HTML Indention issues

Oh, I think this is a simple matter of a feature which nobody thought of hard enough, and therefore noone spent time coding an option to make this behaviour user-selectable.

Offline

#10 2008-05-09 16:02:08

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: HTML Indention issues

Ah, yes, OCD, aka anal retentive

A similar “issue” has been discussed some days ago: Conditionals generate lots of whitespace in markup?

But, really, what’s the problem? If you like to see it perfectly indented when you are viewing the rendered source, then take a look at this suggestion, that is, use HTML Tidy Firefox Extension, view the source, and clean it up.
You will see the source perfectly indented, probably even better than what you could do it manually.

Or do you really care that others seeing your source code look it perfectly indented? Some kind of code voyeurism?

Probably someone could create a plug-in that indents the TxP rendered code after all pages, forms and plug-ins have been rendered… But you will be adding an unnecessary overhead to the process.

Last edited by maniqui (2008-05-09 16:02:26)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#11 2008-05-09 21:01:42

Riyonuk
New Member
Registered: 2008-05-08
Posts: 9

Re: HTML Indention issues

Well I was thinking of writing a script to indent things to my liking, but I would rather prevent it from happening in the first place, then letting it happen, and fixing it.

Offline

#12 2008-05-14 20:04:12

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: HTML Indention issues

Riyonuk wrote:

Well I was thinking of writing a script to indent things to my liking, but I would rather prevent it from happening in the first place, then letting it happen, and fixing it.

I mentioned this on IRC, but you must’ve missed it. The plugin is pretty simple, but if you want to modify an existing one, install jmd_trim. Change the following line

$out = eregi_replace("\n|\r|\t|<!--[^>]*-->", "", parse($thing));

to

$out = eregi_replace("\t", "", parse($thing));

This will let you strip tabs from <txp:body/> and other tags.

<txp:jmd_trim><txp:body/></txp:jmd_trim>

Offline

Board footer

Powered by FluxBB