Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-11 10:17:45

ezee
New Member
From: Germany
Registered: 2005-04-03
Posts: 7
Website

Textile and manually inserted HTML tags

Hello folks,

just a simple question: is it possbile to insert HTML tags manually without having textile messing around with the content?

A little example: I want to use pre-tags in my article to display php-code or whatever, so I type:

<pre>
&lt; pre &gt;
function foo() { return ‘bar’;
}

function foo2($bar) { return $bar;
}
&lt; /pre &gt;
</pre>

What I get once the article is published is the following:

<pre>
&lt; pre &gt;
function foo() { return ‘bar’;
} &lt; p &gt;function foo2($bar) { return $bar;<br />
}<br />
&lt; /pre &gt;&lt; /p &gt;
</pre>

Which is of course not what I want. (Strange, pre-tags seem to be supported by this forum which also uses textile I thought!?)

So does anybody have a solution? Thanks in advance.

Offline

#2 2006-01-11 11:29:46

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Textile and manually inserted HTML tags

Try the code Textile tag.

< code >
some code
some code
some code
some code
< /code >

Other option: begin each line with a space. It will tell Textile not to parse that line.

Offline

#3 2006-01-11 12:51:58

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Textile and manually inserted HTML tags

begin each line with a space. It will tell Textile not to parse that line.

Beginning with a space only prevents auto-wrapping with paragraphs. And it had been a side-effect of implementation only, but I guess given how much it is used, I guess one couldd almost consider it a feature by now.

There is < code > and < notextile > and @, but I think some textiling is always taking place (like replacing double-undersocres with em etc.), so this may or may not be good enough for you.

Currently your options are:
- Either Turn off textile for the article
- Or use a plugin (I remember there is one that people are recommending for this, but can’t remember the name or the concrete functionality)
- or use my above mentioned tags, experiment and see if it is good enough for you.

(Yes, this is on the to-do list and will hopefully, eventually become easier.)

Offline

#4 2006-01-11 13:28:55

ezee
New Member
From: Germany
Registered: 2005-04-03
Posts: 7
Website

Re: Textile and manually inserted HTML tags

Thanks for your suggestions.

The textile-code-tag (at) behaves somewhat strange: it only works with one line of code. If the code contains one or more breaks, nothing will be put between code-tags and the at’s are visible.

Using html-code-tags (< code >) has just the same effect like any other html-tag (the effect I descriped in the beginning).

< notextile > also only works for one line of code.

Beginning every line with a space is also not really an option (at least for big code pieces) like turning textile off.

So maybe anyone remembers the name of the plugin mentioned by Sencer, I couldn’t find anything at textpattern.org.

Last edited by ezee (2006-01-11 13:29:14)

Offline

#5 2006-01-11 22:38:45

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Textile and manually inserted HTML tags

Try < pre > < code > ... < /code > < /pre >.


Alex

Offline

Board footer

Powered by FluxBB