ember-learn / ember-learn/guidemaker-ember-template

Page Anchor links do not have a discernable name

Open
#21 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5
Forks
23
Avg merge
3m
Merged PRs (30d)
3

Description

This markup causes a "links do not have a discernable name" error:

```html


Introducing: Ember Objects


```

Screen Shot 2019-06-26 at 6 35 19 PM

This fix below works to put the text inside a link, but shipping it requires changes to styling. Since the headers become proper links, they need work to make them look like normal headers again.

In guides-article.js:

```js
for (var element of allHeaders) {
if (element.id) {
element.className = 'anchorable-toc'
let link = document.createElement('a');
link.className = 'toc-anchor';
link.href = `#${element.id}`;
link.innerText = element.textContent;
element.innerText = '';
element.appendChild(link, element.firstElementChild);
}
}
```

Results in

```html

Some Text


```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.