linebreak update

implement_matrix
adb 4 years ago
parent 032e56e5c4
commit ce860230e8

@ -36,7 +36,7 @@ wss.on('connection', (ws, req) => {
ws.send(JSON.stringify({type: "error", content: "your message was empty"})) ws.send(JSON.stringify({type: "error", content: "your message was empty"}))
else{ else{
msg.content.user = thisuser msg.content.user = thisuser
msg.content.text = msg.content.text.replace(/</g, "&lt").replace(/>/g, "&gt").replace(/\n/g, "<br>") //msg.content.text = msg.content.text.replace(/</g, "&lt").replace(/>/g, "&gt").replace(/\n/g, "<br>")
wss.clients.forEach(client => client.send(JSON.stringify(msg))) wss.clients.forEach(client => client.send(JSON.stringify(msg)))
} }
else if (msg.type === 'login' && msg.content.user !== ""){ else if (msg.type === 'login' && msg.content.user !== ""){

12
package-lock.json generated

@ -2481,6 +2481,18 @@
"requires": { "requires": {
"inherits": "2.0.1" "inherits": "2.0.1"
} }
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.0.0-rc.1",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-rc.1.tgz",
"integrity": "sha512-yR+BS90EOXTNieasf8ce9J3TFCpm2DGqoqdbtiwQ33hon3FyIznLX7sKavAq1VmfBnOeV6It0Htg4aniv8ph1g==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
} }
} }
}, },

@ -34,6 +34,7 @@ export default {
border-radius: 1rem 1rem 0 1rem; border-radius: 1rem 1rem 0 1rem;
text-align: left; text-align: left;
word-break: break-word; word-break: break-word;
white-space: pre-line;
} }
@media (min-width: 45rem){ @media (min-width: 45rem){

@ -33,5 +33,6 @@ export default {
border-radius: 1rem 1rem 1rem 0; border-radius: 1rem 1rem 1rem 0;
text-align: left; text-align: left;
word-break: break-word; word-break: break-word;
white-space: pre-line;
} }
</style> </style>
Loading…
Cancel
Save