fix (client): handle fg/bg MFM with no color argument
This commit is contained in:
parent
efcce85bac
commit
76fcddec8a
1 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue