Fossil User Forum

Linking to a wiki’s anchor
Login

Linking to a wiki’s anchor

Linking to a wiki's anchor

(1) By anonymous on 2020-07-22 19:07:05 [link] [source]

Is there a way to link to another page's anchor with the markdown syntax?

If i have WikiPage1 with:

### <a name="section1"></a>Section 1

Lorem ipsum ...

### <a name="section2"></a>Section 2

More lorem ipsum...

how can I provide a direct link to WikiPage1#section2 from WikiPage2?

(2) By OgunFossil on 2020-07-23 00:49:26 in reply to 1 [link] [source]

Like a regular link, e.g:

[Section 2](/wiki?name=WikiPage1#section2)

(4) By anonymous on 2020-07-23 15:49:39 in reply to 2 [link] [source]

That works. Thank-you.

I was worried that having the repo in a "sub directory" (e.g. fossil-scm.org/home/) might cause an issue with the /wiki link but it seems to be handled correctly.

(3) By Stephan Beal (stephan) on 2020-07-23 04:34:56 in reply to 1 [link] [source]

i believe Ogun's answer is correct, but here's a just-FYI pedantic sidebar:

### <a name="section1"></a>Section 1

The use of "name" in that way was deprecated/obsoleted in HTML5. The HTML standard now requires "id" instead. See https://stackoverflow.com/a/40739056 for more details.

(5) By anonymous on 2020-07-23 15:50:15 in reply to 3 [source]

Thanks for the tip. I've updated this to be <span id="section1"></span>