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

duplicated entries in toc not functioning properly #23

Open
chiwhalee opened this issue May 16, 2014 · 6 comments
Open

duplicated entries in toc not functioning properly #23

chiwhalee opened this issue May 16, 2014 · 6 comments

Comments

@chiwhalee
Copy link

When I have a toc like the following:

  1. HEAD_A
    1. a
    2. b
  2. HEAD_B
    1. a
    2. c
      If I press 'a' under HEAD_B, it can only jumps to the place where the 'a' under HEAD_A points to. Of course one could distinguish the two 'a' by giving them different names, but this makes the string longer and not clear.
@minrk
Copy link
Owner

minrk commented May 16, 2014

Each heading gets an id based of its content text. HTML IDs must be unique. If there's more than one element with the same ID, visiting the #id hash will navigate to the first. The toc extension doesn't set the IDs, IPython does.

@chiwhalee
Copy link
Author

Is there a workaround for this issue? e.g. let those id generated not just by "a" but by "#HeaD_A#a". Do you plan to improve this?

@minrk
Copy link
Owner

minrk commented May 16, 2014

In the toc extension, while walking IDs to build the toc tree, it would be possible to keep track of seen IDS, and de-duplicate the IDs. It might be tricky to add to IPython itself, since it doesn't normally keep track of the IDs.

@chiwhalee
Copy link
Author

The toc extension is really great. Could you add the de-duplicate functionality, if it is not too involved?

@minrk
Copy link
Owner

minrk commented May 16, 2014

I'm not planning on it, but a pull request would be welcome.

@diego898
Copy link

👍

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

3 participants