forked from FoundKeyGang/FoundKey
add fg and bg tag
This commit is contained in:
parent
eb8463b292
commit
2393487bc2
2 changed files with 13 additions and 1 deletions
|
@ -202,6 +202,18 @@ export default defineComponent({
|
||||||
scale = scale * Math.max(x, y);
|
scale = scale * Math.max(x, y);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'fg': {
|
||||||
|
let color = token.props.args.color;
|
||||||
|
if (!/^[0-9a-f]{3,6}$/i.test(color)) color = 'f00';
|
||||||
|
style = `color: #${color};`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'bg': {
|
||||||
|
let color = token.props.args.color;
|
||||||
|
if (!/^[0-9a-f]{3,6}$/i.test(color)) color = 'f00';
|
||||||
|
style = `background-color: #${color};`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (style == null) {
|
if (style == null) {
|
||||||
return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children, scale), ']']);
|
return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children, scale), ']']);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle', 'rotate', 'position', 'scale'];
|
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle', 'rotate', 'position', 'scale', 'fg', 'bg'];
|
||||||
|
|
Loading…
Reference in a new issue