fix (client): handle fg/bg MFM with no color argument

This commit is contained in:
naskya 2024-06-17 23:48:18 +09:00
parent efcce85bac
commit 76fcddec8a
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -328,13 +328,21 @@ export default defineComponent({
}
case "fg": {
let color = token.props.args.color;
if (!/^[0-9a-f]{3,6}$/i.test(color.toString())) color = "f00";
if (
color == null ||
!/^[0-9a-f]{3,6}$/i.test(color.toString())
)
color = "f00";
style = `color: #${color};`;
break;
}
case "bg": {
let color = token.props.args.color;
if (!/^[0-9a-f]{3,6}$/i.test(color.toString())) color = "f00";
if (
color == null ||
!/^[0-9a-f]{3,6}$/i.test(color.toString())
)
color = "f00";
style = `background-color: #${color};`;
break;
}