Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-24 18:51:26

shinsui
New Member
Registered: 2006-08-22
Posts: 6

<hr /> not possible

I like textile. I don’t want to turn it of. so here’s my question:

If I have a line like:

<hr />

this is rhe rest of the text…

I will not get valid xhtml1.0 this way. Why?

Because textile (wrongly) puts <p> tags around the <hr /> tag.
This should not be done. Like it’s not done around other tags like <div> i.e.

I think this is a bug. I can work around it by putting a space in front (first char).
<div><hr /><br /></div> works too. But it shouldn’t be this way.

Is this a know issue?

Last edited by shinsui (2006-08-24 18:57:29)

Offline

#2 2006-08-25 00:54:21

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

Re: <hr /> not possible

You should be able to get your <hr /> by putting a space as the first “character” of that line. Something like the following:

A normal line of text in an article.

 <hr />

Another normal line of text.

That should do the trick for you. I’ve found this little trick works (to the best of my knowledge) when you want to use it any regular (X)HTML tags.

Last edited by jdykast (2006-08-25 01:09:45)

Offline

#3 2006-08-25 06:27:52

shinsui
New Member
Registered: 2006-08-22
Posts: 6

Re: <hr /> not possible

jdykast wrote:

You should be able to get your <hr /> by putting a space as the first “character” of that line. Something like the following:

A normal line of text in an article.

 <hr />

Another normal line of text.

That should do the trick for you. I’ve found this little trick works (to the best of my knowledge) when you want to use it any regular (X)HTML tags.

This is true.
But the fact remains that textile should not put <p> tags around the <hr />
Furthermore does this trick not work if you want a <hr /> (70% or so) on top of your page.
It’s just a little nuisance of a wonderful package ;-)

Last edited by shinsui (2006-08-25 06:28:37)

Offline

#4 2006-08-25 14:34:04

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

Re: <hr /> not possible

You can get the <hr /> to 70% if you style it using CSS.

Offline

#5 2006-08-25 15:22:58

shinsui
New Member
Registered: 2006-08-22
Posts: 6

Re: <hr /> not possible

jdykast wrote:

You can get the <hr /> to 70% if you style it using CSS.

I know. This is not the issue ;-) My horizontal lines are already CSS’ed for 70%.
It’s about textile that wrongly surrounds the <hr /> with <p> </p>

Offline

#6 2006-08-25 16:06:41

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

Re: <hr /> not possible

I see. I’m no genius when it comes to the behavior of Textile (or concerning much of anything else either). I guess I misunderstood what you meant by:

Furthermore does this trick not work if you want a <hr /> (70% or so) on top of your page.

Using the space first trick you can avoid the <p> tags and get your pure <hr />. How to accomplish without the space I don’t know.

Offline

#7 2006-08-25 16:09:32

Tinshack
Member
From: South Africa
Registered: 2005-12-04
Posts: 18
Website

Re: <hr /> not possible

Textile is meant to work that way. Unless you put a space in front, textile will wrap what it sees as a paragraph in <code><p></code> tags.

Putting a space in front of your <code><hr /></code> tells textile not to treat it as a paragraph. The same goes for other HTML. Putting a space in front of each line of a bock of html will tell textile to leave it as is.

For example:

<code>
<div>
This is my text
spanning multiple lines
with no spaces in front
</div>
</code><br />

gets textiled as

<code>
<p><div>This is my text<br />
Spanning multiple lines<br />
with no spaces in front<br />
</div></p>
</code><br />

When you put spaces in front of each line then it works as you’d expect. This is the result.

<code> <div></code>
<code> This is my text</code>
<code> spanning multiple lines</code>
<code> with spaces in front</code>
<code> </div>
</code><br />

This feature is designed to allow you to mix textile and html together although I must admit that I took forever to figure out how not to get my <code><hr /></code> tags wrapped in <code><p></code>‘s

Edit: changed my post to make textile render my code better

Last edited by Tinshack (2006-08-25 16:20:09)

Offline

#8 2006-08-25 16:45:07

shinsui
New Member
Registered: 2006-08-22
Posts: 6

Re: <hr /> not possible

Tinshack wrote:

Textile is meant to work that way. Unless you put a space in front, textile will wrap what it sees as a paragraph in <code><p></code> tags.

Putting a space in front of your <code><hr /></code> tells textile not to treat it as a paragraph. The same goes for other HTML. Putting a space in front of each line of a bock of html will tell textile to leave it as is.

For example:

<code>
<div>
This is my text
spanning multiple lines
with no spaces in front
</div>
</code><br />

gets textiled as

<code>
<p><div>This is my text<br />
Spanning multiple lines<br />
with no spaces in front<br />
</div></p>
</code><br />

When you put spaces in front of each line then it works as you’d expect. This is the result.

And this is not true!
Your first codelines, with the <div> </div> don’t need a space in front of them! Try it yourself. A “div” is NOT surrounded by <p> </p>
It seems textile is clever enough to ‘know’a div does not need them. That’s why I thought it’s a pity it does not know the same ‘knowledge’ in case of the <hr /> Also NEVER surrrounded by P’s

So what I don’t quite understand is why in one case textile acts ‘clever’ and in another I need a ‘space hack’ ;-)

Grtz.

Offline

#9 2006-08-25 18:19:37

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

Re: <hr /> not possible

I just tried the <div> sample without using a space. The following text

bc..<div>
Some text
</div>

was rendered as the following HTML

<p><div><br />Some text<br /></div></p>

My experience seems to agree with Tinshack’s.

Offline

#10 2006-08-25 19:06:17

shinsui
New Member
Registered: 2006-08-22
Posts: 6

Re: <hr /> not possible

jdykast wrote:

I just tried the <div> sample without using a space. The following text

bc..<div>
Some text
</div>

was rendered as the following HTML

<p><div><br />Some text<br /></div></p>

My experience seems to agree with Tinshack’s.

textpattern 4.0.3 =>

<div>
Some text
</div>

and this is the next alinea

renders as follows:

<div>
Some text
</div>
    <p>and this is the next alinea</p>

So, how come my textpattern version acts differently?

Last edited by shinsui (2006-08-25 19:07:13)

Offline

#11 2006-08-27 08:14:20

Tinshack
Member
From: South Africa
Registered: 2005-12-04
Posts: 18
Website

Re: <hr /> not possible

Textile is sometimes changed between different versions of textpattern (bug fixes, improvements etc). The difference you’re describing is probably because you’re using an older version.

This time round you might find it easier to write the entire article in html and “leave text untouched” for that article (look under advanced options when you’ve got your article open in the write tab).

Offline

Board footer

Powered by FluxBB