Merge branch 'develop' into schedule-note

This commit is contained in:
かっこかり 2023-11-18 00:21:56 +09:00 committed by GitHub
commit 3413b394e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 1011 additions and 834 deletions

View file

@ -276,9 +276,18 @@ export class MfmService {
},
fn: (node) => {
const el = doc.createElement('i');
appendChildren(node.children, el);
return el;
if (node.props.name === 'unixtime') {
const text = node.children[0]!.type === 'text' ? node.children[0].props.text : '';
const date = new Date(parseInt(text, 10) * 1000);
const el = doc.createElement('time');
el.setAttribute('datetime', date.toISOString());
el.textContent = date.toISOString();
return el;
} else {
const el = doc.createElement('i');
appendChildren(node.children, el);
return el;
}
},
blockCode: (node) => {