Skip to content

Commit

Permalink
fix: Fixed the issue that the link text does not wrap, causing abnorm…
Browse files Browse the repository at this point in the history
…al content layout

fix: Fix the problem of image compression ratio
  • Loading branch information
Amery2010 committed Feb 3, 2025
1 parent 6f2874e commit 1c9c702
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions components/Magicdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Magicdown({ children: content, className, ...rest }: Options) {
}
},
a: (props) => {
const { children, href = '', target, ...rest } = props
const { children, className, href = '', target, ...rest } = props
if (/\.(aac|mp3|opus|wav)$/.test(href)) {
return (
<figure>
Expand All @@ -85,7 +85,12 @@ function Magicdown({ children: content, className, ...rest }: Options) {
}
const isInternal = /^\/#/i.test(href)
return (
<a {...omit(rest, ['node'])} href={href} target={isInternal ? '_self' : target ?? '_blank'}>
<a
{...omit(rest, ['node'])}
className={clsx('break-all', className)}
href={href}
target={isInternal ? '_self' : target ?? '_blank'}
>
{children}
</a>
)
Expand Down
3 changes: 1 addition & 2 deletions utils/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ type imageUploadOptions = {
}

const compressionOptions = {
maxSizeMB: 2,
maxWidthOrHeight: 1024,
maxSizeMB: 4,
useWebWorker: true,
initialQuality: 0.85,
libURL: 'scripts/browser-image-compression.js',
Expand Down

0 comments on commit 1c9c702

Please sign in to comment.