
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
Anchor tracking for TOC not working with anchors within tables Β· Issue #4689 Β· squidfunk/mkdocs-material
Description:
Contribution guidelines I've read the contribution guidelines and wholeheartedly agree I've found a bug and checked that ... ... the problem doesn't occur with the mkdocs or readthedocs...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Social Networks
- Mobile Technology & AI
- Careers
Content Management System {π}
What CMS is github.com built with?
Github.com relies on WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,653,780 visitors per month in the current month.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 5,316,107 paying customers.
The estimated monthly recurring revenue (MRR) is $22,327,651.
The estimated annual recurring revenues (ARR) are $267,931,808.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
squidfunk, issue, problem, anchors, tables, bug, toc, added, table, open, sign, ive, behaviour, commented, resolved, projects, anchor, tracking, closed, mkdocs, extracss, related, page, theme, material, owner, react, navigation, source, search, code, issues, pull, requests, actions, security, working, description, contribution, guidelines, found, removed, scrolling, reside, correctly, strange, expected, view, highlighted, work,
Topics {βοΈ}
/mh166/mkdocs-custom-anchors/blob/main/mkdocs src/assets/javascripts/components/toc/index source code activity squidfunk added closed issues open projects added custom anchors issue adding annotations bug resolved issue contribution guidelines py system information improved tooltips render comment metadata assignees squidfunk closed search recently material theme definition behave absolutely correctly projects milestone generalize offset computation mh166 extra_css investigation issue problem description anchor tracking material markdown_extensions open mkdocs tracked correctly py hook 4 mkdocs absolutely amazing anchors apparently wholeheartedly agree readthedocs themes discussed previously reproduce result default theme yml site_name attr_list copyright css hooks multiple browsers excellent reproduction made fixing community edition funding goal wrong position roll back hacky workarounds visually disabling milestone relationships
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
- Maybe somewhere starting from Line #158?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:Anchor tracking for TOC not working with anchors within tables
articleBody:### Contribution guidelines
- [X] I've read the [contribution guidelines](https://github.com/squidfunk/mkdocs-material/blob/master/CONTRIBUTING.md) and wholeheartedly agree
### I've found a bug and checked that ...
- [X] ... the problem doesn't occur with the `mkdocs` or `readthedocs` themes
- [X] ... the problem persists when all overrides are removed, i.e. `custom_dir`, `extra_javascript` and `extra_css`
- [X] ... the documentation does not mention anything about my problem
- [X] ... there are no open or closed issues that are related to my problem
### Description
As [discussed previously](https://github.com/mkdocs/mkdocs/discussions/3038#discussioncomment-4149646), I went ahead and added custom anchors to the page's TOC.
Unfortunately, when scrolling down, anchors that reside within a `<table>` are not tracked correctly.
From what I've seen, [src/assets/javascripts/components/toc/index.ts](https://github.com/squidfunk/mkdocs-material/blob/13655d68f5c3514f1a03733ef7b2ecb96bc0d2fe/src/assets/javascripts/components/toc/index.ts) is responsible for this functionality. Maybe somewhere starting from [Line #158](https://github.com/squidfunk/mkdocs-material/blob/13655d68f5c3514f1a03733ef7b2ecb96bc0d2fe/src/assets/javascripts/components/toc/index.ts#L158)? Unfortunately, it's above my level of expertise to understand where the strange behaviour is coming from.
### Expected behaviour
Within the TOC, the section currently in view should be highlighted.
### Actual behaviour
This does work only for anchors that DO NOT reside within a `<table>`. Those behave absolutely correctly.
But with those inside a `<table>` it is strange: is the page scrolled to the very top, an anchor from within the table is highlighted as active - even though it's not in view. And once you start scrolling, those anchors apparently get ignored.
### Steps to reproduce
**Result:**
- Just take a look at my [example page](https://mh166.github.io/mkdocs-custom-anchors/). This is a minimal project to demo this problem.
**Try for yourself:**
- [The source code](https://github.com/mh166/mkdocs-custom-anchors) is also available
- Using the [`customAnchors.py` hook](https://github.com/mh166/mkdocs-custom-anchors/blob/main/customAnchors.py), I look for `<strong>` tags containing the `id="..."` attribute. Those get added to the TOC.
- With the `mkdoc`'s default theme, everything works as expected (clone the repo and remove the material theme definition from the config
### Package versions
- Python: `3.9.4`
- MkDocs: `1.4.0`
- Material: `8.5.3`
### Configuration
```yaml
# Can be found here: https://github.com/mh166/mkdocs-custom-anchors/blob/main/mkdocs.yml
site_name: "Demo: problem with anchors within tables"
theme:
name: material
markdown_extensions:
- attr_list
copyright: mh166
extra_css:
- extra.css
hooks:
- customAnchors.py
```
### System information
I've tried on Windows 10 using multiple browsers (Chrome, Edge, Opera). All show the same behaviour.
author:
url:https://github.com/mh166
type:Person
name:mh166
datePublished:2022-11-29T10:10:48.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:4
url:https://github.com/4689/mkdocs-material/issues/4689
context:https://schema.org
headline:Anchor tracking for TOC not working with anchors within tables
articleBody:### Contribution guidelines
- [X] I've read the [contribution guidelines](https://github.com/squidfunk/mkdocs-material/blob/master/CONTRIBUTING.md) and wholeheartedly agree
### I've found a bug and checked that ...
- [X] ... the problem doesn't occur with the `mkdocs` or `readthedocs` themes
- [X] ... the problem persists when all overrides are removed, i.e. `custom_dir`, `extra_javascript` and `extra_css`
- [X] ... the documentation does not mention anything about my problem
- [X] ... there are no open or closed issues that are related to my problem
### Description
As [discussed previously](https://github.com/mkdocs/mkdocs/discussions/3038#discussioncomment-4149646), I went ahead and added custom anchors to the page's TOC.
Unfortunately, when scrolling down, anchors that reside within a `<table>` are not tracked correctly.
From what I've seen, [src/assets/javascripts/components/toc/index.ts](https://github.com/squidfunk/mkdocs-material/blob/13655d68f5c3514f1a03733ef7b2ecb96bc0d2fe/src/assets/javascripts/components/toc/index.ts) is responsible for this functionality. Maybe somewhere starting from [Line #158](https://github.com/squidfunk/mkdocs-material/blob/13655d68f5c3514f1a03733ef7b2ecb96bc0d2fe/src/assets/javascripts/components/toc/index.ts#L158)? Unfortunately, it's above my level of expertise to understand where the strange behaviour is coming from.
### Expected behaviour
Within the TOC, the section currently in view should be highlighted.
### Actual behaviour
This does work only for anchors that DO NOT reside within a `<table>`. Those behave absolutely correctly.
But with those inside a `<table>` it is strange: is the page scrolled to the very top, an anchor from within the table is highlighted as active - even though it's not in view. And once you start scrolling, those anchors apparently get ignored.
### Steps to reproduce
**Result:**
- Just take a look at my [example page](https://mh166.github.io/mkdocs-custom-anchors/). This is a minimal project to demo this problem.
**Try for yourself:**
- [The source code](https://github.com/mh166/mkdocs-custom-anchors) is also available
- Using the [`customAnchors.py` hook](https://github.com/mh166/mkdocs-custom-anchors/blob/main/customAnchors.py), I look for `<strong>` tags containing the `id="..."` attribute. Those get added to the TOC.
- With the `mkdoc`'s default theme, everything works as expected (clone the repo and remove the material theme definition from the config
### Package versions
- Python: `3.9.4`
- MkDocs: `1.4.0`
- Material: `8.5.3`
### Configuration
```yaml
# Can be found here: https://github.com/mh166/mkdocs-custom-anchors/blob/main/mkdocs.yml
site_name: "Demo: problem with anchors within tables"
theme:
name: material
markdown_extensions:
- attr_list
copyright: mh166
extra_css:
- extra.css
hooks:
- customAnchors.py
```
### System information
I've tried on Windows 10 using multiple browsers (Chrome, Edge, Opera). All show the same behaviour.
author:
url:https://github.com/mh166
type:Person
name:mh166
datePublished:2022-11-29T10:10:48.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:4
url:https://github.com/4689/mkdocs-material/issues/4689
Person:
url:https://github.com/mh166
name:mh166
url:https://github.com/mh166
name:mh166
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:4
interactionType:https://schema.org/CommentAction
userInteractionCount:4
External Links {π}(3)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net