-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09af238
commit 0502d29
Showing
11 changed files
with
81 additions
and
105 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,10 @@ | ||
import { beforeAll, beforeEach } from 'vitest' | ||
import { beforeAll } from 'vitest' | ||
import { setProjectAnnotations } from '@storybook/nextjs' | ||
import * as rendererDocsAnnotations from '@storybook/react/dist/entry-preview-docs.mjs' | ||
import * as rscAnnotations from '@storybook/react/dist/entry-preview-rsc.mjs' | ||
import * as addonActionsAnnotations from '@storybook/addon-actions/preview' | ||
import * as addonInteractionsAnnotations from '@storybook/addon-interactions/preview' | ||
import * as projectAnnotations from './preview' | ||
import "./polyfills/promise-with-resolvers"; | ||
// promise with resolveres polyfill | ||
import '@ungap/with-resolvers' | ||
|
||
|
||
const { cleanup, render: testingLibraryRender } = await import( | ||
'@testing-library/react/pure' | ||
) | ||
|
||
beforeEach(cleanup) | ||
|
||
const annotations = setProjectAnnotations([ | ||
rscAnnotations, | ||
rendererDocsAnnotations, | ||
addonActionsAnnotations, | ||
addonInteractionsAnnotations, | ||
projectAnnotations, | ||
{ testingLibraryRender }, | ||
]) | ||
const annotations = setProjectAnnotations([projectAnnotations, rscAnnotations]) | ||
|
||
beforeAll(annotations.beforeAll!) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// This module gives a lot of warnings when run in the browser. | ||
// See https://github.com/apostrophecms/sanitize-html/issues/664 | ||
export const sanitizeHtml = (html: string) => html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import _sanitizeHtml from 'sanitize-html' | ||
|
||
const allowedTags = _sanitizeHtml.defaults.allowedTags.concat([ | ||
'img', | ||
'h1', | ||
'h2', | ||
'h3', | ||
]) | ||
const allowedAttributes = Object.assign( | ||
{}, | ||
_sanitizeHtml.defaults.allowedAttributes, | ||
{ | ||
img: ['alt', 'src'], | ||
}, | ||
) | ||
|
||
export const sanitizeHtml = (html: string) => { | ||
return _sanitizeHtml(html, { | ||
allowedTags, | ||
allowedAttributes, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.