Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Built files
dist
.svelte-kit
build

# Dependencies
node_modules
.npmrc

coverage
# Test files
coverage
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "markdoc-svelte",
"version": "4.0.0",
"version": "4.1.0",
"type": "module",
"description": "A preprocessor to render Markdoc in Svelte",
"sideEffects": false,
Expand Down
8 changes: 4 additions & 4 deletions src/headings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tag } from "@markdoc/markdoc";
import Markdoc from "@markdoc/markdoc";
import type { RenderableTreeNode, Schema } from "@markdoc/markdoc";

import type { MarkdocSvelteConfig, SluggerType } from "./types.ts";
Expand All @@ -22,7 +22,7 @@
return children.reduce((text: string, child): string => {
if (typeof child === "string" || typeof child === "number") {
return text + child;
} else if (typeof child === "object" && Tag.isTag(child)) {
} else if (typeof child === "object" && Markdoc.Tag.isTag(child)) {

Check warning on line 25 in src/headings.ts

View workflow job for this annotation

GitHub Actions / lint

Caution: `Markdoc` also has a named export `Tag`. Check if you meant to write `import {Tag} from '@markdoc/markdoc'` instead
return text + getTextContent(child.children);
}
return text;
Expand Down Expand Up @@ -72,7 +72,7 @@
}

if ("name" in node) {
const tag = node as Tag;
const tag = node as Markdoc.Tag;

// Handle basic headings
if (tag.name.match(/^h\d$/)) {
Expand Down Expand Up @@ -126,6 +126,6 @@
level: level as number,
};

return new Tag(render, tagProps, children);
return new Markdoc.Tag(render, tagProps, children);

Check warning on line 129 in src/headings.ts

View workflow job for this annotation

GitHub Actions / lint

Caution: `Markdoc` also has a named export `Tag`. Check if you meant to write `import {Tag} from '@markdoc/markdoc'` instead
},
};
Loading