You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation, when page headings that don't have a user-supplied id, one is generated using the Pandoc id-generation algorithm. As such, if a period character (.) appears in the text of the heading, it will be included in the id that is generated.
This poses a problem when the default theme is used: if a heading has an auto-generated id that contains a period, the navigation at the right side of the page will not work for that heading. To reproduce, check out the Ornate docs, and try clicking on any of the links for sections with the release version as the header (e.g. v0.6).
This appears to be because the default theme uses jQuery selectors somewhere in the implementation for page navigation, for which . is a special character. To properly match a literal . in an id with jQuery selectors, it needs to be escaped.
I'm not very familiar with Ornate, so I'm not sure what the most desirable fix for this would be. As far as I can tell, there are three options for a fix:
Update the docs to let users know they should provide ids for headings containing . if they're using the default theme
Update the default theme to special-case . and put a \\ in front of it in selectors used for page navigation
Update the auto-id functionality to either ignore ., replace it with -, or escape it as \. (and update the docs to note this modification to the Pandoc algorithm)
Would love to hear thoughts on a good direction to take; I'm happy to put together a PR for whatever option is desirable to the maintainers, if that would be helpful.
The text was updated successfully, but these errors were encountered:
According to the documentation, when page headings that don't have a user-supplied
id
, one is generated using the Pandocid
-generation algorithm. As such, if a period character (.
) appears in the text of the heading, it will be included in theid
that is generated.This poses a problem when the default theme is used: if a heading has an auto-generated
id
that contains a period, the navigation at the right side of the page will not work for that heading. To reproduce, check out the Ornate docs, and try clicking on any of the links for sections with the release version as the header (e.g.v0.6
).This appears to be because the default theme uses jQuery selectors somewhere in the implementation for page navigation, for which
.
is a special character. To properly match a literal.
in anid
with jQuery selectors, it needs to be escaped.I'm not very familiar with Ornate, so I'm not sure what the most desirable fix for this would be. As far as I can tell, there are three options for a fix:
id
s for headings containing.
if they're using the default theme.
and put a\\
in front of it in selectors used for page navigationid
functionality to either ignore.
, replace it with-
, or escape it as\.
(and update the docs to note this modification to the Pandoc algorithm)Would love to hear thoughts on a good direction to take; I'm happy to put together a PR for whatever option is desirable to the maintainers, if that would be helpful.
The text was updated successfully, but these errors were encountered: