Skip to content

Commit 985dedf

Browse files
committed
doc: Update README.md
1 parent 0f1790e commit 985dedf

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

core/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const source = `
4545

4646
export default function Demo() {
4747
return (
48-
<MarkdownPreview source={source} />
48+
<MarkdownPreview source={source} style={{ padding: 16 }} />
4949
)
5050
}
5151
```
@@ -68,6 +68,7 @@ export default function Demo() {
6868
return (
6969
<MarkdownPreview
7070
source={source}
71+
style={{ padding: 16 }}
7172
rehypeRewrite={(node, index, parent) => {
7273
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
7374
parent.children = parent.children.slice(1)
@@ -103,6 +104,7 @@ export default function Demo() {
103104
return (
104105
<MarkdownPreview
105106
source={source}
107+
style={{ padding: 16 }}
106108
rehypeRewrite={(node, index, parent) => {
107109
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
108110
parent.children = parent.children.slice(1)
@@ -138,6 +140,7 @@ export default function Demo() {
138140
return (
139141
<MarkdownPreview
140142
source={source}
143+
style={{ padding: 16 }}
141144
rehypeRewrite={(node, index, parent) => {
142145
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
143146
parent.children = parent.children.slice(1)
@@ -169,7 +172,7 @@ function () {
169172

170173
export default function Demo() {
171174
return (
172-
<MarkdownPreview source={source} />
175+
<MarkdownPreview source={source} style={{ padding: 16 }} />
173176
);
174177
}
175178
```
@@ -199,6 +202,7 @@ export default function Demo() {
199202
return (
200203
<MarkdownPreview
201204
source={source}
205+
style={{ padding: 16 }}
202206
rehypeRewrite={(node, index, parent) => {
203207
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
204208
parent.children = parent.children.slice(1)
@@ -228,6 +232,7 @@ export default function Demo() {
228232
return (
229233
<MarkdownPreview
230234
source={source}
235+
style={{ padding: 16 }}
231236
rehypeRewrite={(node, index, parent) => {
232237
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
233238
parent.children = parent.children.slice(1)
@@ -271,6 +276,7 @@ export default function Demo() {
271276
return (
272277
<MarkdownPreview
273278
source={source}
279+
style={{ padding: 16 }}
274280
components={{
275281
code: ({ children = [], className, ...props }) => {
276282
if (typeof children === 'string' && /^\$\$(.*)\$\$/.test(children)) {
@@ -384,6 +390,7 @@ export default function Demo() {
384390
return (
385391
<MarkdownPreview
386392
source={source}
393+
style={{ padding: 16 }}
387394
components={{
388395
code: Code
389396
}}
@@ -414,7 +421,7 @@ const source = `
414421
const rehypePlugins = [rehypeSanitize];
415422
export default function Demo() {
416423
return (
417-
<MarkdownPreview source={source} rehypePlugins={rehypePlugins} />
424+
<MarkdownPreview source={source} rehypePlugins={rehypePlugins} style={{ padding: 16 }} />
418425
)
419426
}
420427
```
@@ -638,7 +645,7 @@ const source = `>
638645

639646
export default function Demo() {
640647
return (
641-
<MarkdownPreview source={source} />
648+
<MarkdownPreview source={source} style={{ padding: 16 }} />
642649
)
643650
}
644651
```

website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"map": "source-map-explorer build/static/js/*.js --html build/website-result.html"
99
},
1010
"dependencies": {
11-
"@uiw/react-markdown-preview-example": "^2.0.0",
11+
"@uiw/react-markdown-preview-example": "^2.1.3",
1212
"@uiw/react-shields": "^2.0.1",
1313
"katex": "^0.16.9",
1414
"mermaid": "^10.6.1",
@@ -21,7 +21,7 @@
2121
"@kkt/less-modules": "^7.4.7",
2222
"@kkt/scope-plugin-options": "^7.4.7",
2323
"kkt": "^7.4.7",
24-
"markdown-react-code-preview-loader": "^2.1.5",
24+
"markdown-react-code-preview-loader": "^2.1.8",
2525
"prettier": "^2.8.4",
2626
"pretty-quick": "^3.1.3",
2727
"react-test-renderer": "^18.2.0",

0 commit comments

Comments
 (0)