make MarkDown into a class and fixed emojis
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Contextmenu } from "./contextmenu.js";
|
||||
import { User } from "./user.js";
|
||||
import { Member } from "./member.js";
|
||||
import { markdown } from "./markdown.js";
|
||||
import { MarkDown } from "./markdown.js";
|
||||
import { Embed } from "./embed.js";
|
||||
import { File } from "./file.js";
|
||||
class Message {
|
||||
@@ -33,7 +33,7 @@ class Message {
|
||||
}
|
||||
static setupcmenu() {
|
||||
Message.contextmenu.addbutton("Copy raw text", function () {
|
||||
navigator.clipboard.writeText(this.content);
|
||||
navigator.clipboard.writeText(this.content.rawString);
|
||||
});
|
||||
Message.contextmenu.addbutton("Reply", function (div) {
|
||||
this.channel.setReplying(this);
|
||||
@@ -63,6 +63,10 @@ class Message {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else if (thing === "content") {
|
||||
this.content = new MarkDown(messagejson[thing], this.channel);
|
||||
continue;
|
||||
}
|
||||
this[thing] = messagejson[thing];
|
||||
}
|
||||
for (const thing in this.embeds) {
|
||||
@@ -204,7 +208,7 @@ class Message {
|
||||
replyline.classList.add("replyflex");
|
||||
this.channel.getmessage(this.message_reference.message_id).then(message => {
|
||||
const author = message.author;
|
||||
reply.appendChild(markdown(message.content, { stdsize: true }));
|
||||
reply.appendChild(message.content.makeHTML({ stdsize: true }));
|
||||
minipfp.src = author.getpfpsrc();
|
||||
author.bind(minipfp);
|
||||
username.textContent = author.username;
|
||||
@@ -266,7 +270,7 @@ class Message {
|
||||
else {
|
||||
div.classList.remove("topMessage");
|
||||
}
|
||||
const messaged = markdown(this.content);
|
||||
const messaged = this.content.makeHTML();
|
||||
div["txt"] = messaged;
|
||||
const messagedwrap = document.createElement("div");
|
||||
messagedwrap.classList.add("flexttb");
|
||||
|
Reference in New Issue
Block a user