aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/webAO/client.js b/webAO/client.js
index 14bfd08..a59508e 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -10,7 +10,7 @@ import fileExistsSync from './utils/fileExistsSync';
import {
escapeChat, encodeChat, prepChat, safeTags,
} from './encoding.js';
-
+import mlConfig from './utils/aoml';
// Load some defaults for the background and evidence dropdowns
import vanilla_character_arr from './constants/characters.js';
import vanilla_music_arr from './constants/music.js';
@@ -43,6 +43,8 @@ const DEFAULT_HOST = 'http://attorneyoffline.de/base/';
let AO_HOST = asset || DEFAULT_HOST;
const THEME = theme || 'default';
+const attorneyMarkdown = mlConfig(AO_HOST)
+
const UPDATE_INTERVAL = 60;
/**
@@ -1938,6 +1940,7 @@ class Viewport {
* @param {object} chatmsg the new chat message
*/
async say(chatmsg) {
+
this.chatmsg = chatmsg;
this.textnow = '';
this.sfxplayed = 0;
@@ -2089,7 +2092,7 @@ class Viewport {
if (soundChecks.some((check) => this.chatmsg.sound === check)) {
this.chatmsg.sound = this.chatmsg.effects[2];
}
-
+ this.chatmsg.parsed = attorneyMarkdown.applyMarkdown(chatmsg.content)
this.tick();
}
@@ -2242,7 +2245,7 @@ class Viewport {
}
this.textnow = this.chatmsg.content.substring(0, this.textnow.length + 1);
- chatBoxInner.innerText = this.textnow;
+ chatBoxInner.appendChild(this.chatmsg.parsed[this.textnow.length - 1]);
// scroll to bottom
chatBox.scrollTop = chatBox.scrollHeight;
@@ -2325,6 +2328,7 @@ export function onEnter(event) {
if (emote_mod === 0) { emote_mod = 1; }
} else if (emote_mod === 1) { emote_mod = 0; }
+
client.sendIC(
'chat',
myemo.preanim,