Textile question: redcloth anchor links

1.1k Views Asked by At

How do I write this in textile (i'm using the redcloth gem)

<a href="#tips">Visit the Useful Tips Section</a>
<a name="tips">Useful Tips Section</a>

I know the first part, "Visit the Useful Tips Section":#tips but how do I make the named anchor?

Thanks!

Deb

2

There are 2 best solutions below

0
On BEST ANSWER

h1(#tips) Useful Tips Section. -- Achieves the same effect (with some css)

1
On

The textile manual seems to indicate that there's no way to do so other than just using straight HTML:

<a name="tips"></a>
<h1>Useful Tips Section</h1>

The answer that suggests:

h1(#tips). Useful Tips Section

is incorrect as it will generate:

<h1 id="tips">Useful Tips Section</h1>

which is not a named anchor. However, you could use some Javascript to make this work.