Fixed actions not being italicised and backported the apostrophe thing.

This commit is contained in:
flash 2024-01-21 16:57:56 +00:00
commit f5701b6c76
3 changed files with 27 additions and 13 deletions
src/ami.js

View file

@ -52,18 +52,26 @@ var AmiMessageList = function(parent) {
},
child: nameBody,
},
{
];
if(msgInfo.showColon)
messageBody.push({
tag: 'span',
attrs: { className: 'msgColon' },
child: msgInfo.showColon ? ':' : '',
},
' ',
{
child: ':',
});
if(msgInfo.isAction) {
if(msgInfo.bodyText.indexOf("'") !== 0 || (msgInfo.bodyText.match(/\'/g).length % 2) === 0)
messageBody.push(' ');
} else {
messageBody.push(' ');
messageBody.push({
tag: 'span',
attrs: { className: 'msgBreak' },
child: { tag: 'br' },
},
];
});
}
if(msgInfo.isPM) {
if(msgInfo.pmTargetName)
@ -87,7 +95,10 @@ var AmiMessageList = function(parent) {
child: messageBody,
});
message.insertAdjacentHTML('beforeend', msgInfo.bodyRaw);
let msgBodyTarget = message;
if(msgInfo.isAction)
message.appendChild(msgBodyTarget = $e({ tag: 'i' }));
msgBodyTarget.insertAdjacentHTML('beforeend', msgInfo.bodyRaw);
if(msgInfo.canDelete)
message.appendChild($e({