If a character string such as a pictogram that is not allowed according to the XML standard is entered, it will be output as is to the site map and invalid XML will be generated. #814
If input like a 🌞Sun is rising🌞 word, it is include emoji(XML standard is not allowed characters), export invalid XML.
If these are entered, an error should occur internally, or the invalid string should be deleted. Otherwise, invalid XML will be generated.
To Reproduce
This is app router. Maybe page router too.
Steps to reproduce the behavior:
In the sitemap route.tsx|jsx, write below code.
export async function GET() {
return getServerSideSitemap([
{
loc: 'https://example.com',
images: [
{
title: '🌞Sun is rising🌞',
loc: new URL('https://example.com'),
},
],
},
]);
}
Access sitemap route via Google Chrome.
Error throwed the below.
This page contains the following errors:
error on line 3 at column 113: xmlParseCharRef: invalid xmlChar value 55356
Below is a rendering of the page up to the first error.
Expected behavior
An error message indicating that an invalid string has been entered, or the string is replaced with an empty string (it is desirable to have an option for this)
Describe the bug
If input like a
🌞Sun is rising🌞
word, it is include emoji(XML standard is not allowed characters), export invalid XML.If these are entered, an error should occur internally, or the invalid string should be deleted. Otherwise, invalid XML will be generated.
To Reproduce
This is app router. Maybe page router too.
Steps to reproduce the behavior:
Expected behavior
An error message indicating that an invalid string has been entered, or the string is replaced with an empty string (it is desirable to have an option for this)
Screenshots
error
expected
Additional context