2

I'm using Jekyll with Kramdown on Github, and I wonder whether there's a way to link to a line within a page. Say I have

some line here

and later I want to link to this line. If this line were a section then an ID would be autogenerated. But here it is just a simple line. I tried putting

some line here {#idhere}

and later link as

[link](#idhere)

but it didn't work.

1 Answer 1

1

Follow the block with a block inline attribute list: {: id="one_id"} or the short version: {: #one_id}

In your example:

some line here 
{: id="idhere"}

or

some line here 
{: #idhere}

and later link as

[link](#idhere)
3
  • It doesn't work; it just show up as "{: id="idhere"}" or "{: #idhere}" after the line. Apr 27, 2017 at 17:17
  • Ok, seems like the ID part just needs to be put on a separate line. Apr 27, 2017 at 17:31
  • 1
    @user7843034 that's it! Fixed in answer.
    – marcanuy
    Apr 27, 2017 at 17:31

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.