1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-14 11:45:57 +00:00

Wrap the text in the "source" page.

See #332.
This commit is contained in:
Trevor Buckner
2018-04-17 21:03:50 -04:00
committed by Rae2che5
parent 3583c2e776
commit 073fb73bde

View File

@@ -49,7 +49,7 @@ app.get('/source/:id', (req, res)=>{
HomebrewModel.get({ shareId: req.params.id }) HomebrewModel.get({ shareId: req.params.id })
.then((brew)=>{ .then((brew)=>{
const text = brew.text.replaceAll('<', '&lt;').replaceAll('>', '&gt;'); const text = brew.text.replaceAll('<', '&lt;').replaceAll('>', '&gt;');
return res.send(`<code><pre>${text}</pre></code>`); return res.send(`<code><pre style="white-space: pre-wrap;">${text}</pre></code>`);
}) })
.catch((err)=>{ .catch((err)=>{
console.log(err); console.log(err);