Skip to content

Instantly share code, notes, and snippets.

@watagashi
Last active Aug 9, 2021
Embed
What would you like to do?
registerPlugin({
newMessageElement: function (elem) {
var removeBr = function (st) {
var br;
for (;;) {
br = st.getElementsByTagName('br')[0];
if (!br) return;
try {
st.replaceChild(document.createTextNode(' \r'), br);
} catch (e) {
// parent of node to be replaced is already missing.
return;
}
}
},
searchStatus = function (elem) {
var st = elem.getElementsByClassName('status')[0];
if (!st) return;
removeBr(st);
return st;
},
st = elem;
while (st) {
st = searchStatus(st);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment