File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,9 @@ function optimizeImagesFromPost(markdown: string) {
29
29
/ (?: ! \[ ( .* ?) \] \( h t t p s : \/ \/ i m a g e s .v e l o g .i o \/ ( .* ?) \) ) / g,
30
30
) ;
31
31
if ( ! matches ) return markdown ;
32
- const replacers = matches . map ( match => [
32
+ const replacers = matches . map ( ( match ) => [
33
33
match ,
34
- match . replace ( 'https://images.velog.io/' , 'https://media.vlpt.us ' ) ,
34
+ match . replace ( 'https://images.velog.io/' , 'https://velog.velcdn.com ' ) ,
35
35
] ) ;
36
36
return replacers . reduce ( ( acc , [ original , optimized ] ) => {
37
37
return acc . replace ( original , optimized ) ;
@@ -41,9 +41,10 @@ function optimizeImagesFromPost(markdown: string) {
41
41
const PostContent : React . FC < PostContentProps > = ( { isMarkdown, body } ) => {
42
42
const [ html , setHtml ] = useState ( isMarkdown ? null : body ) ;
43
43
const dispatch = usePostViewerDispatch ( ) ;
44
- const imageOptimizedPost = useMemo ( ( ) => optimizeImagesFromPost ( body ) , [
45
- body ,
46
- ] ) ;
44
+ const imageOptimizedPost = useMemo (
45
+ ( ) => optimizeImagesFromPost ( body ) ,
46
+ [ body ] ,
47
+ ) ;
47
48
48
49
useEffect ( ( ) => {
49
50
if ( ! html ) return ;
You can’t perform that action at this time.
0 commit comments