File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ export async function generateStaticParams() {
4040
4141export default async function Post ( { params } : { params : { post : string } } ) {
4242 const { isEnabled } = draftMode ( )
43- console . log ( { isEnabled } )
4443
4544 const { post : slug } = params
4645 const posts = ( await getAllPosts ( isEnabled ) ) ?? [ ]
@@ -59,7 +58,6 @@ export default async function Post({ params }: { params: { post: string } }) {
5958 notFound ( )
6059 }
6160
62- console . log ( new Date ( ) . toISOString ( ) , `Generating post ${ post ?. title } ` )
6361 return (
6462 < SinglePost latest = { latest } prev = { prev } next = { next } post = { { ...post , image : post . image } } />
6563 )
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ export async function SinglePost(props: Props) {
3131 . replace ( / < \! - - .* ?- - > / g, '' )
3232 . replace ( / < p > & n b s p ; < \/ p > / g, '' )
3333 . replace ( / & n b s p ; / g, ' ' )
34+ // get rid of all inline styles
35+ // this is not very safe
36+ . replace ( / ( < \w { 1 , 3 } ) s t y l e = " .* ?" / g, '$1' )
3437 // only one h1
3538 . replace ( / ( < \/ ) ? h 1 / g, '$1h2' )
3639 // give h2 and h3 tags ids so the table of contents can link to them
You can’t perform that action at this time.
0 commit comments