Compare commits

..

1 Commits

Author SHA1 Message Date
Luccas Mateus
88ccee6f0a [@portaljs/ckan][sm] - fix types 2023-08-14 11:02:56 -03:00
9 changed files with 21 additions and 84 deletions

View File

@@ -0,0 +1,5 @@
---
'@portaljs/ckan': patch
---
added package_count to organization type

View File

@@ -1,11 +1,5 @@
# @portaljs/ckan # @portaljs/ckan
## 0.0.4
### Patch Changes
- [#1009](https://github.com/datopian/portaljs/pull/1009) [`099f3c52`](https://github.com/datopian/portaljs/commit/099f3c520407a7215b5b41f67dc8ea5ac73d07c4) Thanks [@luccasmmg](https://github.com/luccasmmg)! - added package_count to organization type
## 0.0.3 ## 0.0.3
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@portaljs/ckan", "name": "@portaljs/ckan",
"version": "0.0.4", "version": "0.0.3",
"type": "module", "type": "module",
"description": "https://portaljs.org", "description": "https://portaljs.org",
"keywords": [ "keywords": [

View File

@@ -1,11 +1,5 @@
# @portaljs/remark-wiki-link # @portaljs/remark-wiki-link
## 1.1.0
### Minor Changes
- [#1006](https://github.com/datopian/portaljs/pull/1006) [`6418dbb7`](https://github.com/datopian/portaljs/commit/6418dbb7e246fa17b56840c64daa043112dc9189) Thanks [@olayway](https://github.com/olayway)! - Parse note embeds as regular wiki links (until we add proper support for note embeds).
## 1.0.4 ## 1.0.4
### Patch Changes ### Patch Changes

View File

@@ -1,6 +1,6 @@
{ {
"name": "@portaljs/remark-wiki-link", "name": "@portaljs/remark-wiki-link",
"version": "1.1.0", "version": "1.0.4",
"description": "Parse and render wiki-style links in markdown especially Obsidian style links.", "description": "Parse and render wiki-style links in markdown especially Obsidian style links.",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@@ -125,16 +125,6 @@ function fromMarkdown(opts: FromMarkdownOptions = {}) {
if (isEmbed) { if (isEmbed) {
const [isSupportedFormat, format] = isSupportedFileFormat(target); const [isSupportedFormat, format] = isSupportedFileFormat(target);
if (!isSupportedFormat) { if (!isSupportedFormat) {
// Temporarily render note transclusion as a regular wiki link
if (!format) {
wikiLink.data.hName = "a";
wikiLink.data.hProperties = {
className: classNames + " " + "transclusion",
href: hrefTemplate(link) + headingId,
};
wikiLink.data.hChildren = [{ type: "text", value: displayName }];
} else {
wikiLink.data.hName = "p"; wikiLink.data.hName = "p";
wikiLink.data.hChildren = [ wikiLink.data.hChildren = [
{ {
@@ -142,7 +132,6 @@ function fromMarkdown(opts: FromMarkdownOptions = {}) {
value: `![[${target}]]`, value: `![[${target}]]`,
}, },
]; ];
}
} else if (format === "pdf") { } else if (format === "pdf") {
wikiLink.data.hName = "iframe"; wikiLink.data.hName = "iframe";
wikiLink.data.hProperties = { wikiLink.data.hProperties = {

View File

@@ -108,16 +108,7 @@ function html(opts: HtmlOptions = {}) {
if (isEmbed) { if (isEmbed) {
const [isSupportedFormat, format] = isSupportedFileFormat(target); const [isSupportedFormat, format] = isSupportedFileFormat(target);
if (!isSupportedFormat) { if (!isSupportedFormat) {
// Temporarily render note transclusion as a regular wiki link
if (!format) {
this.tag(
`<a href="${hrefTemplate(link + headingId)}" class="${classNames} transclusion">`
);
this.raw(displayName);
this.tag("</a>");
} else {
this.raw(`![[${target}]]`); this.raw(`![[${target}]]`);
}
} else if (format === "pdf") { } else if (format === "pdf") {
this.tag( this.tag(
`<iframe width="100%" src="${hrefTemplate( `<iframe width="100%" src="${hrefTemplate(

View File

@@ -309,16 +309,4 @@ describe("micromark-extension-wiki-link", () => {
expect(serialized).toBe('<p><a href="/" class="internal">/index</a></p>'); expect(serialized).toBe('<p><a href="/" class="internal">/index</a></p>');
}); });
}); });
describe("transclusions", () => {
test("parsers a transclusion as a regular wiki link", () => {
const serialized = micromark("![[Some Page]]", "ascii", {
extensions: [syntax()],
htmlExtensions: [html() as any], // TODO type fix
});
expect(serialized).toBe(
'<p><a href="Some Page" class="internal new transclusion">Some Page</a></p>'
);
});
});
}); });

View File

@@ -535,28 +535,4 @@ describe("remark-wiki-link", () => {
}); });
}); });
}); });
describe("transclusions", () => {
test("replaces a transclusion with a regular wiki link", () => {
const processor = unified().use(markdown).use(wikiLinkPlugin);
let ast = processor.parse("![[Some Page]]");
ast = processor.runSync(ast);
expect(select("wikiLink", ast)).not.toEqual(null);
visit(ast, "wikiLink", (node: Node) => {
expect(node.data?.isEmbed).toEqual(true);
expect(node.data?.exists).toEqual(false);
expect(node.data?.permalink).toEqual("Some Page");
expect(node.data?.alias).toEqual(null);
expect(node.data?.hName).toEqual("a");
expect((node.data?.hProperties as any).className).toEqual(
"internal new transclusion"
);
expect((node.data?.hProperties as any).href).toEqual("Some Page");
expect((node.data?.hChildren as any)[0].value).toEqual("Some Page");
});
});
});
}); });