添付されたメディアのURLは省略して表示するように

This commit is contained in:
syuilo
2018-05-17 23:38:35 +09:00
parent e1672e539b
commit 89a58dc596
4 changed files with 47 additions and 3 deletions

View File

@ -0,0 +1,16 @@
export default function(note) {
if (note.text == null) return true;
let txt = note.text;
if (note.media) {
note.media.forEach(file => {
txt = txt.replace(file.url, '');
if (file.src) txt = txt.replace(file.src, '');
});
if (txt == '') return true;
}
return false;
}