1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-12 23: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 })
.then((brew)=>{
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)=>{
console.log(err);
@@ -138,4 +138,4 @@ app.use((req, res)=>{
const PORT = process.env.PORT || 8000;
app.listen(PORT);
console.log(`server on port:${PORT}`);
console.log(`server on port:${PORT}`);