@skbkontur/markdown 1.0.5 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,6 +12,8 @@
12
12
  Тема `Textarea` берется из ThemeContext из react-ui.
13
13
  Стилизация `Markdown` через `MarkdownThemeProvider`.
14
14
 
15
+ ### [Примеры использования](https://stackblitz.com/edit/skbkontur-markdown?file=src%2FApp.tsx)
16
+
15
17
  ### Markdown
16
18
  #### Props
17
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/markdown",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -27,12 +27,15 @@
27
27
  "bump": "lerna version",
28
28
  "build": "yarn tsc",
29
29
  "lint-staged": "lint-staged",
30
- "lint": "eslint --ext=ts,tsx src",
30
+ "lint": "eslint --ext=ts,tsx src && yarn stylelint",
31
31
  "lint:fix": "eslint --ext=.ts,tsx src --fix",
32
+ "stylelint": "stylelint 'src/**/*.{tsx,ts}'",
32
33
  "prepare": "husky install .husky",
33
- "build-storybook": "build-storybook --quiet",
34
34
  "storybook": "start-storybook -p 6006 -s public",
35
+ "build-storybook": "build-storybook --quiet",
35
36
  "test-storybook": "test-storybook",
37
+ "test": "jest test",
38
+ "test:ci": "cross-env CI=true jest test --passWithNoTests --testResultsProcessor=jest-teamcity-reporter",
36
39
  "creevey:ui": "creevey --ui --port=3003",
37
40
  "screenshots:ci": "concurrently -k -s first \"http-server ./storybook-static -p 6006 -s\" \"yarn creevey\" \"yarn test-storybook\""
38
41
  },
@@ -56,6 +59,9 @@
56
59
  "@storybook/preset-create-react-app": "4.1.2",
57
60
  "@storybook/react": "6.5.16",
58
61
  "@storybook/test-runner": "0.9.4",
62
+ "@swc/core": "1.3.50",
63
+ "@swc/jest": "0.2.26",
64
+ "@types/jest": "29.5.0",
59
65
  "@types/node": "12.0.0",
60
66
  "@types/react": "16.9.0",
61
67
  "@types/react-dom": "16.9.0",
@@ -65,7 +71,9 @@
65
71
  "@typescript-eslint/eslint-plugin": "5.57.0",
66
72
  "@typescript-eslint/parser": "5.57.0",
67
73
  "axe-playwright": "1.2.3",
74
+ "concurrently": "^7.0.0",
68
75
  "creevey": "0.9.0-beta.5",
76
+ "cross-env": "6.0.3",
69
77
  "eslint": "8.32.0",
70
78
  "eslint-config-prettier": "8.8.0",
71
79
  "eslint-plugin-import": "2.27.5",
@@ -75,9 +83,11 @@
75
83
  "eslint-plugin-react-hooks": "4.6.0",
76
84
  "eslint-plugin-storybook": "0.6.12",
77
85
  "eslint-plugin-typescript-sort-keys": "2.3.0",
86
+ "http-server": "14.1.0",
78
87
  "husky": "7.0.4",
79
88
  "jest": "29.5.0",
80
89
  "jest-environment-jsdom": "29.5.0",
90
+ "jest-teamcity-reporter": "0.9.0",
81
91
  "lerna": "5.0.0",
82
92
  "lint-staged": "^12.3.4",
83
93
  "prettier": "2.2.1",
@@ -2,6 +2,7 @@ import { Checkbox } from '@skbkontur/react-ui';
2
2
  import React from 'react';
3
3
  import ReactMarkdown from 'react-markdown';
4
4
  import rehypeRaw from 'rehype-raw';
5
+ import rehypeSanitize from 'rehype-sanitize';
5
6
  import remarkBreaks from 'remark-breaks';
6
7
  import gfm from 'remark-gfm';
7
8
  import { MarkdownImage } from './Helpers/MarkdownImage';
@@ -16,7 +17,7 @@ export var MarkdownViewer = function (_a) {
16
17
  return null;
17
18
  }
18
19
  return (React.createElement(Wrapper, { "aria-label": "\u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442" },
19
- React.createElement(ReactMarkdown, { components: getCustomComponents(), remarkPlugins: [gfm, remarkBreaks], rehypePlugins: [rehypeRaw], linkTarget: "_blank" }, source)));
20
+ React.createElement(ReactMarkdown, { components: getCustomComponents(), remarkPlugins: [gfm, remarkBreaks], rehypePlugins: [rehypeRaw, rehypeSanitize], linkTarget: "_blank" }, source)));
20
21
  function getCustomComponents() {
21
22
  return {
22
23
  a: renderLink,