Skip to content

Commit

Permalink
Use marked-gfm-heading-id for markdown headers
Browse files Browse the repository at this point in the history
  • Loading branch information
abraham committed Oct 4, 2023
1 parent 0fa80de commit a0477a0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"firebase": "^10.4.0",
"lit": "^2.8.0",
"marked": "^9.0.3",
"marked-gfm-heading-id": "^3.1.0",
"pwa-helpers": "^0.9.1",
"register-service-worker": "^1.7.2",
"web-vitals": "^3.5.0"
Expand Down
5 changes: 2 additions & 3 deletions src/components/markdown/base.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { html } from 'lit';
import { property } from 'lit/decorators.js';
import { marked } from 'marked';
import { gfmHeadingId } from 'marked-gfm-heading-id';
import { hasUnsupportedTags, unsupportedHtmlTags } from '../../utils/markdown';
import { ThemedElement } from '../themed-element';

marked.setOptions({
headerIds: true,
});
marked.use(gfmHeadingId());

export class Markdown extends ThemedElement {
static override get styles() {
Expand Down

0 comments on commit a0477a0

Please sign in to comment.