refactor: Improve GenericModal coloredContent function

Update the coloredContent function in GenericModal to ensure the input value is converted to a string before applying replacements. This change improves the reliability and consistency of the function.
This commit is contained in:
ogabrielluiz 2024-06-12 23:23:33 -03:00
commit ccb9ba3307

View file

@ -99,6 +99,7 @@ export default function GenericModal({
setInputValue(value);
}, [value, modalOpen]);
const coloredContent = (inputValue || "")
?.toString()
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(regexHighlight, (match, p1, p2) => {