RedCloth/Textile question

J

Jim Menard

How do I escape naked markup characters like "*" and "+"?

_why_, I've also added a few new bug reports to the Rubyforge tracker.

Jim
 
J

Jim Menard

Jim said:
How do I escape naked markup characters like "*" and "+"?

More information: a single character works as expected. For example, with the
input

This is * intersting.

the asterisk is output. But this

This is "*" interesting because I am talking about "*" characters.

outputs the text between the asterisks as bold. Is there any way to turn off
the meaning of "*", "+", etc. so that it does not start a region of marked up
text?

Another question: can I insert literal HTML characters like &42; (which is an
asterisk)?

Jim
 
W

why the lucky stiff

Jim said:
But this

This is "*" interesting because I am talking about "*" characters.

outputs the text between the asterisks as bold. Is there any way to turn off
the meaning of "*", "+", etc. so that it does not start a region of marked up
text?
For protecting short phrases from RedCloth's processor, surround with
double equals signs.

in: ==This is "*" interesting because I am talking about "*" characters.==
out: This is "*" interesting because I am talking about "*" characters.

in: This *bold* but this is ==*asterisked*==.
out: This <strong>bold</strong> but this is *asterisked*.

If you have a large block of text you want protected, you can surround
it with <notextile> tags. In addition, <pre> and <code> contents are
protected from Textile formatting.

I'll clarify this in the reference @ http://hobix.com/textile/
Another question: can I insert literal HTML characters like &42; (which is an
asterisk)?
You should be able to. Looks like this is broken (frown) but I will put
this in the stack. Thanks for the bug report, Jim.

_why
 
G

Gavin Sinclair

If you have a large block of text you want protected, you can surround
it with <notextile> tags. In addition, <pre> and <code> contents are
protected from Textile formatting.

If you want to use some formatting (bold, italic, ...) in a code
block, are there any good methods?

Gavin
 
W

why the lucky stiff

Gavin said:
If you want to use some formatting (bold, italic, ...) in a code
block, are there any good methods?

I haven't thought much about this. Immediately, I'd say you would need
to use a tag other than <pre> or <code>. Right now I just wrap those
sorts of code blocks in <div class="formattedCode"> tags and then be
sure to give the formattedCode class <pre>-like css properties.

With RedCloth 2.1, you'll also be able to override RedCloth's default
handling of elements. Would that be okay?

_why
 
J

Jim Menard

why said:
I haven't thought much about this. Immediately, I'd say you would need
to use a tag other than <pre> or <code>. Right now I just wrap those
sorts of code blocks in <div class="formattedCode"> tags and then be
sure to give the formattedCode class <pre>-like css properties.

With RedCloth 2.1, you'll also be able to override RedCloth's default
handling of elements. Would that be okay?

Hmm...I did not see Gavin's message or any others except my original post and
this one.

I didn't know about <notextile> or ==notextile==. I'll give them a try. Time
to read the source code.

Jim
 
G

Gavin Sinclair

I haven't thought much about this. Immediately, I'd say you would need
to use a tag other than <pre> or <code>. Right now I just wrap those
sorts of code blocks in <div class="formattedCode"> tags and then be
sure to give the formattedCode class <pre>-like css properties.
With RedCloth 2.1, you'll also be able to override RedCloth's default
handling of elements. Would that be okay?

I'm curious more than anything. I'd rather see a standard for this
sort of thing than have to roll my own, but again I'm not aching for
it.

Thanks,
Gavin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top