Merge pull request #2617 from ecency/nt/discard-span

remove <span> tags from post content
This commit is contained in:
Feruz M 2023-02-04 20:48:54 +02:00 committed by GitHub
commit 128c1cf669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,11 @@ export const PostHtmlRenderer = memo(
const postImgUrlsRef = useRef<string[]>([]);
// new renderer functions
body = body.replace(/<center>/g, '<div class="text-center">').replace(/<\/center>/g, '</div>');
body = body
.replace(/<center>/g, '<div class="text-center">')
.replace(/<\/center>/g, '</div>')
.replace(/<span>/g, '')
.replace(/<\/span>/g, '');
console.log('Comment body:', body);