Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-23 09:20:55

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

[textile] Textiles's Code Block rendering Textile v2

Textile’s default HTML to entities rendering behavior is a convenient thing to have.

The problem turns up, when we need to wrap our codeblock with something like this:

<pre><code class="html">
				<!-- code example goes here -->

</code></pre>

Which we would presumable do with:

bc(html).

Which Textile will now mistakenly render like this:

<pre class="html"><code class="html">
				<!-- code example goes here -->
		</code></pre>

This isn’t quite what we wanted, since it now makes it impossible to target our code tag solely by class only.

This , I think is a Bug with the Textile Parser.

Note: Bug has been reported at Treshholdstate.

Last edited by marios (2008-02-23 09:36:40)


⌃ ⇧ < ⌃ ⇧ >

Offline

#2 2008-02-25 01:14:35

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [textile] Textiles's Code Block rendering Textile v2

…makes it impossible to target our code tag solely by class only.

Nope. :) Use the selectors as well:

.html {
	/* applies to both tags */
}

pre.html {
	/* applies only to pre tag */
}

code.html {
	/* applies only to code tag */
}

Offline

#3 2008-02-25 01:31:14

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: [textile] Textiles's Code Block rendering Textile v2

and if you want to get super specific

pre.html code.html {
  /* stuff */
}

Shoving is the answer – pusher robot

Offline

#4 2008-02-25 14:18:47

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: [textile] Textiles's Code Block rendering Textile v2

Sorry, if I missed something.

A rule of pre.diagram code.html, on the other hand will NOT match a codeblock that is a child of pre.html

The Cascade makes this an entirely different thing.

However, not that important anyway.

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#5 2008-02-25 15:10:36

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] Textiles's Code Block rendering Textile v2

A rule of pre.diagram code.html, on the other hand will NOT match a codeblock that is a child of pre.html

O’really ;) How about this:

pre code.html {
	content: "I love candy :-)";
}

Last edited by Gocom (2008-02-25 15:11:00)

Offline

#6 2008-02-25 16:29:51

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: [textile] Textiles's Code Block rendering Textile v2

Gocom wrote:

bq. A rule of pre.diagram code.html, on the other hand will NOT match a codeblock that is a child of pre.html

O’really ;) How about this:

pre code.html {
	content: "I love candy :-)";
}

Right, may be I didn’t express myself right.
A rule of pre code.html WOULD match ALL occurences of code.html.

What, if you wanted to match only those code.html tags, that are ONLY children of a pre tag with a class of .diagram?

(See what I mean with cascade ? )

regards, marios

Last edited by marios (2008-02-25 16:30:25)


⌃ ⇧ < ⌃ ⇧ >

Offline

#7 2008-02-27 02:30:18

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [textile] Textiles's Code Block rendering Textile v2

I’m a little lost, where is the pre.diagram coming from? Or are you saying you want to be able to target individual code blocks on a page?

Offline

#8 2008-02-27 09:17:31

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: [textile] Textiles's Code Block rendering Textile v2

That was the Idea.
There could be occurences of:

  • pre.diagram code.html
  • pre.code code.php
  • pre.code code.html

… and so on.
( However, not so important right now )

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

Board footer

Powered by FluxBB