ported mfm
All checks were successful
Test (production install and build) / production (22.x) (pull_request) Successful in 2m33s
Test (frontend) / vitest (22.x) (pull_request) Successful in 3m11s
Lint / pnpm_install (pull_request) Successful in 3m55s
Lint / lint (misskey-js) (pull_request) Successful in 3m18s
Lint / lint (backend) (pull_request) Successful in 5m20s
Lint / lint (sw) (pull_request) Successful in 3m58s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m44s
Lint / typecheck (backend) (pull_request) Successful in 4m53s
Lint / lint (frontend) (pull_request) Successful in 9m42s

This commit is contained in:
Leah 2025-02-03 14:13:54 +01:00
parent f4bda8582f
commit 4c8d44564c
2 changed files with 17 additions and 1 deletions

View file

@ -294,6 +294,20 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
style = `background-color: #${color}; overflow-wrap: anywhere;`;
break;
}
case 'small': {
return h(
"small",
{
style: "opacity: 0.7;",
}, genEl(token.children));
}
case 'center': {
return h(
"div",
{
style: "text-align: center;",
}, genEl(token.children));
}
case 'border': {
let color = validColor(token.props.args.color);
color = color ? `#${color}` : 'var(--accent)';

View file

@ -122,7 +122,7 @@ export const DEFAULT_SERVER_ERROR_IMAGE_URL = 'https://xn--931a.moe/assets/error
export const DEFAULT_NOT_FOUND_IMAGE_URL = 'https://xn--931a.moe/assets/not-found.jpg';
export const DEFAULT_INFO_IMAGE_URL = 'https://xn--931a.moe/assets/info.jpg';
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'scale', 'position', 'fg', 'bg', 'border', 'font', 'blur', 'rainbow', 'sparkle', 'rotate', 'ruby', 'unixtime', 'crop', 'fade'];
export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'scale', 'position', 'fg', 'bg', 'border', 'font', 'blur', 'rainbow', 'sparkle', 'rotate', 'ruby', 'unixtime', 'crop', 'fade', 'center', 'small'];
export const MFM_PARAMS: Record<typeof MFM_TAGS[number], string[]> = {
tada: ['speed=', 'delay='],
jelly: ['speed=', 'delay='],
@ -148,4 +148,6 @@ export const MFM_PARAMS: Record<typeof MFM_TAGS[number], string[]> = {
unixtime: [],
fade: ['speed=', 'delay=', 'loop=', 'out'],
crop: ['top=', 'bottom=', 'left=', 'right='],
center: [],
small: [],
};