mirror of
https://github.com/thelittlerocket/rss-to-email.git
synced 2025-03-01 11:23:05 +08:00
Update screenshot (#45)
* update screenshot * add key to suppress react warning
This commit is contained in:
parent
23b68080e8
commit
3defdc5a37
2 changed files with 8 additions and 3 deletions
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 240 KiB |
|
@ -1,3 +1,4 @@
|
||||||
|
import { Fragment } from 'react'
|
||||||
import { parse } from 'node-html-parser'
|
import { parse } from 'node-html-parser'
|
||||||
import { Text } from '@react-email/text'
|
import { Text } from '@react-email/text'
|
||||||
import { Link } from '@react-email/link'
|
import { Link } from '@react-email/link'
|
||||||
|
@ -20,11 +21,15 @@ export default ({ content, href }: Props) => {
|
||||||
{elements.map((element) => {
|
{elements.map((element) => {
|
||||||
switch (element.localName) {
|
switch (element.localName) {
|
||||||
case 'p':
|
case 'p':
|
||||||
return <Text style={text}>{element.text}</Text>
|
return (
|
||||||
|
<Text key="p" style={text}>
|
||||||
|
{element.text}
|
||||||
|
</Text>
|
||||||
|
)
|
||||||
case 'blockquote':
|
case 'blockquote':
|
||||||
const paragraphs = element.querySelectorAll('> p')
|
const paragraphs = element.querySelectorAll('> p')
|
||||||
return (
|
return (
|
||||||
<>
|
<Fragment key="blockquote">
|
||||||
<Text style={blockquote}>{paragraphs[0].text ?? ''}</Text>
|
<Text style={blockquote}>{paragraphs[0].text ?? ''}</Text>
|
||||||
{blockquoteHasMore && (
|
{blockquoteHasMore && (
|
||||||
<Text style={blockquote}>
|
<Text style={blockquote}>
|
||||||
|
@ -33,7 +38,7 @@ export default ({ content, href }: Props) => {
|
||||||
</Link>
|
</Link>
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</>
|
</Fragment>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
|
|
Loading…
Reference in a new issue