Skip to content

Commit 9579118

Browse files
committed
Revert anchors links feature
Anchor links are out of scope for this component. Anchor links are best handled dynamically, for example with static HTML generators, or hand -coded. This reverts commit ff843b4.
1 parent ff843b4 commit 9579118

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vellum-doc",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "A simple document web component for web publishing",
55
"main": "vellum-doc.js",
66
"module": "vellum-doc.js",

src/vellum-doc.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,6 @@ export class VellumDocument extends LitElement {
9797
})
9898
}
9999

100-
anchorHeadings() {
101-
this.headings.forEach(heading => {
102-
const spacing = document.createTextNode(' ')
103-
heading.append(spacing)
104-
105-
const anchor = document.createElement('a')
106-
anchor.href = `#${heading.id}`
107-
anchor.innerHTML = '#'
108-
anchor.className = 'anchor'
109-
anchor.title = heading.textContent ? heading.textContent : ''
110-
111-
heading.append(anchor)
112-
})
113-
}
114-
115100
override render() {
116101
return html`
117102
<div id="sidebar">
@@ -141,10 +126,6 @@ export class VellumDocument extends LitElement {
141126
html`<a href="#${id}">${heading}</a>`
142127
)
143128
}
144-
145-
override updated() {
146-
this.anchorHeadings()
147-
}
148129
}
149130

150131
declare global {

0 commit comments

Comments
 (0)