Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with #id links when id contains spaces #34

Closed
jgm opened this issue Jun 10, 2011 · 2 comments
Closed

problem with #id links when id contains spaces #34

jgm opened this issue Jun 10, 2011 · 2 comments
Assignees

Comments

@jgm
Copy link
Owner

jgm commented Jun 10, 2011

Bug noted by Colin Adams:

Run pandoc on this input

Several moves have been tried for White, but only [P 4e -4f](#4.P 4e -
4f) works reasonably:

and later:
#4.P 4e - 4f


Several moves have been tried for White, but only P 4e –4f works reasonably:</p

and:

4.P 4e - 4f

Google Code Info:
Issue #: 206
Author: fiddloso...@gmail.com
Created On: 2010-01-17T17:51:47.000Z
Closed On: 2010-01-17T18:13:44.000Z

@ghost ghost assigned jgm Jun 10, 2011
@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

Google Code Info:
Author: fiddloso...@gmail.com
Created On: 2010-01-17T17:52:00.000Z

@jgm jgm closed this as completed Jun 10, 2011
@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

My mistake: this is not a bug. See
http://johnmacfarlane.net/pandoc/README.html#header-identifiers-in-html

Html ID attributes cannot contain spaces. For that reason, the
id pandoc generates from a title will replace the spaces with hyphens,
as explained in the manual. It also replaces uppercase with lowercase.
Hence, for the title "P 4e - 4f", the id is:

id="p-4e---4f

This looks a bit weird, because you already had a hyphen in the title.
But the rule is being followed, and it is simple enough to remember.
So, if you want to link to this header, you have to use the generated
id:
Several moves have been tried for White, but only
P 4e -4f works reasonably:

Google Code Info:
Author: fiddloso...@gmail.com
Created On: 2010-01-17T18:13:44.000Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant