Skip to content
Snippets Groups Projects
Commit 4b3f9bd9 authored by syuilo's avatar syuilo
Browse files

enhance(backend): MFMのunixtimeをISO形式で連合するように

parent 5f5712a3
No related branches found
No related tags found
No related merge requests found
......@@ -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) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment