diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/CodeSlot.astro b/packages/astro-ghostcms-rendercontent/examples/CodeSlot.astro similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/CodeSlot.astro rename to packages/astro-ghostcms-rendercontent/examples/CodeSlot.astro diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/H1.astro b/packages/astro-ghostcms-rendercontent/examples/H1.astro similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/H1.astro rename to packages/astro-ghostcms-rendercontent/examples/H1.astro diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/H2.astro b/packages/astro-ghostcms-rendercontent/examples/H2.astro similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/H2.astro rename to packages/astro-ghostcms-rendercontent/examples/H2.astro diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/H3.astro b/packages/astro-ghostcms-rendercontent/examples/H3.astro similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/H3.astro rename to packages/astro-ghostcms-rendercontent/examples/H3.astro diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/H4.astro b/packages/astro-ghostcms-rendercontent/examples/H4.astro similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/H4.astro rename to packages/astro-ghostcms-rendercontent/examples/H4.astro diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/H5.astro b/packages/astro-ghostcms-rendercontent/examples/H5.astro similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/H5.astro rename to packages/astro-ghostcms-rendercontent/examples/H5.astro diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/H6.astro b/packages/astro-ghostcms-rendercontent/examples/H6.astro similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/H6.astro rename to packages/astro-ghostcms-rendercontent/examples/H6.astro diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/Paragraph.astro b/packages/astro-ghostcms-rendercontent/examples/Paragraph.astro similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/Paragraph.astro rename to packages/astro-ghostcms-rendercontent/examples/Paragraph.astro diff --git a/packages/astro-ghostcms-rendercontent/examples/ghostrender/index.ts b/packages/astro-ghostcms-rendercontent/examples/index.ts similarity index 100% rename from packages/astro-ghostcms-rendercontent/examples/ghostrender/index.ts rename to packages/astro-ghostcms-rendercontent/examples/index.ts diff --git a/packages/astro-ghostcms-rendercontent/lib/GhostRender.astro b/packages/astro-ghostcms-rendercontent/lib/GhostRender.astro index ae2cdd5b..c3b5490d 100644 --- a/packages/astro-ghostcms-rendercontent/lib/GhostRender.astro +++ b/packages/astro-ghostcms-rendercontent/lib/GhostRender.astro @@ -1,10 +1,8 @@ --- -import type { SanitizeOptions } from 'ultrahtml/transformers/sanitize' import { createComponentProxy, html } from './utils'; export interface Props { content?: string; - sanitize?: SanitizeOptions; components?: Record; } @@ -14,7 +12,7 @@ if (!input) { } // @ts-ignore const components = createComponentProxy($$result, Astro.props.components); -const content = await html(input, { sanitize: Astro.props.sanitize, components }); +const content = await html(input, { components }); --- diff --git a/packages/astro-ghostcms-rendercontent/lib/utils.ts b/packages/astro-ghostcms-rendercontent/lib/utils.ts index 45ee2ebe..3ddb4668 100644 --- a/packages/astro-ghostcms-rendercontent/lib/utils.ts +++ b/packages/astro-ghostcms-rendercontent/lib/utils.ts @@ -46,8 +46,6 @@ export function dedent(str: string): string { export interface HTMLOptions { // biome-ignore lint/complexity/noBannedTypes: -sanitize?: {}; - // biome-ignore lint/complexity/noBannedTypes: components?: {}; } diff --git a/packages/astro-ghostcms-rendercontent/package.json b/packages/astro-ghostcms-rendercontent/package.json index efed7866..ffe73c05 100644 --- a/packages/astro-ghostcms-rendercontent/package.json +++ b/packages/astro-ghostcms-rendercontent/package.json @@ -25,6 +25,7 @@ "exports": { ".": "./index.ts", "./lib/*": "./lib/*", + "./examples/*": "./examples/*", "./package.json": "./package.json" }, "keywords": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbd0a7a7..eee91098 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -126,6 +126,9 @@ importers: '@matthiesenxyz/astro-ghostcms': specifier: ^3.2.1 version: link:../astro-ghostcms + '@matthiesenxyz/astro-ghostcms-rendercontent': + specifier: ^0.0.1 + version: 0.0.1 '@unocss/astro': specifier: ^0.57.7 version: 0.57.7(vite@5.0.12) @@ -148,9 +151,6 @@ importers: specifier: ^0.57.7 version: 0.57.7(postcss@8.4.33)(vite@5.0.12) devDependencies: - '@matthiesenxyz/astro-ghostcms-rendercontent': - specifier: workspace:* - version: link:../astro-ghostcms-rendercontent '@typescript-eslint/parser': specifier: ^6.21.0 version: 6.21.0(eslint@8.56.0)(typescript@5.3.3) @@ -208,9 +208,6 @@ importers: entities: specifier: ^4.5.0 version: 4.5.0 - node-html-parser: - specifier: 6.1.12 - version: 6.1.12 ultrahtml: specifier: ^1.5.2 version: 1.5.2 @@ -1503,6 +1500,13 @@ packages: globby: 11.1.0 read-yaml-file: 1.1.0 + /@matthiesenxyz/astro-ghostcms-rendercontent@0.0.1: + resolution: {integrity: sha512-2zXmCnAoFHZqvkEuccUY0uN/legpXxn0LzVvERc2w8bjTnOPTB+fQN35fc+OiyFZJEy+jgcvwM76ZA3dVgPayQ==} + dependencies: + entities: 4.5.0 + ultrahtml: 1.5.2 + dev: false + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -3186,6 +3190,7 @@ packages: /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + dev: true /boxen@7.1.1: resolution: {integrity: sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==} @@ -3551,6 +3556,7 @@ packages: domhandler: 5.0.3 domutils: 3.1.0 nth-check: 2.1.1 + dev: true /css-to-react-native@3.2.0: resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} @@ -3570,6 +3576,7 @@ packages: /css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} + dev: true /cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} @@ -3770,15 +3777,18 @@ packages: domelementtype: 2.3.0 domhandler: 5.0.3 entities: 4.5.0 + dev: true /domelementtype@2.3.0: resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} + dev: true /domhandler@5.0.3: resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} engines: {node: '>= 4'} dependencies: domelementtype: 2.3.0 + dev: true /domutils@3.1.0: resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} @@ -3786,6 +3796,7 @@ packages: dom-serializer: 2.0.0 domelementtype: 2.3.0 domhandler: 5.0.3 + dev: true /dset@3.1.3: resolution: {integrity: sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==} @@ -4817,6 +4828,7 @@ packages: /he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + dev: true /hex-rgb@4.3.0: resolution: {integrity: sha512-Ox1pJVrDCyGHMG9CFg1tmrRUMRPRsAWYc/PinY0XzJU4K7y7vjNoLKIQ7BR5UJMCxNN8EM1MNDmHWA/B3aZUuw==} @@ -5951,6 +5963,7 @@ packages: dependencies: css-select: 5.1.0 he: 1.2.0 + dev: true /node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} @@ -5993,6 +6006,7 @@ packages: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} dependencies: boolbase: 1.0.0 + dev: true /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}