Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#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
Re: HTML Indention issues
What means OCD?
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
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
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
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
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)
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
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
Pages: 1