export function slug ( name ) { const slugId = name . trim ( ) . replace ( /_/g , '' ) . replace ( /[./\\]/g , '-' ) . replace ( /[^\w-]/g , '' ) ; const id = `user-content-${ slugId }` ; const link = `#${ slugId }` ; return { id , link } ; }