mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-04-24 23:47:19 -05:00
fix(posts): infinite loading due to replaceAll() not being present in Node 14
This commit is contained in:
parent
7e7cac8ee8
commit
390f6975b7
|
|
@ -92,8 +92,8 @@ router.get('/:slug', async (request, response, next) => {
|
|||
|
||||
// Replace [yt-iframe](videoID) with the full <iframe />
|
||||
content = content
|
||||
.replaceAll(/(?<!`)\[yt-iframe]\(/g, '<div class="aspectratio-fallback"><iframe src="https://www.youtube-nocookie.com/embed/')
|
||||
.replaceAll(/(?<=<iframe src="https:\/\/www\.youtube-nocookie\.com\/embed\/.{11})\)/g, '" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>');
|
||||
.replace(/(?<!`)\[yt-iframe]\(/g, '<div class="aspectratio-fallback"><iframe src="https://www.youtube-nocookie.com/embed/')
|
||||
.replace(/(?<=<iframe src="https:\/\/www\.youtube-nocookie\.com\/embed\/.{11})\)/g, '" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>');
|
||||
|
||||
// Convert the content into HTML
|
||||
const htmlPost = marked(content);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user