Skip to content

Commit f5a38cc

Browse files
author
Spazcool
committed
ADD: marked library & tested
1 parent 724464e commit f5a38cc

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

app.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const express = require('express');
22

3+
const marked = require('marked');
4+
35
const qr = require('qr-image');
46

57
const { loadDatabase, searchDatabase } = require('./googleSpreadsheet');
@@ -69,7 +71,13 @@ app.get('/:uuid', (req, res) => {
6971
matches[0].similarItems = searchDatabase({ fixture: matches[0].fixture }, allItems)
7072
.filter(item => item.uuid !== matches[0].uuid)
7173
.splice(0, 3);
72-
res.render('item', matches[0]);
74+
// const mark = marked(matches[0].HOWTO)
75+
// function markItUp(a) {
76+
// return {__html: a};
77+
// }
78+
// <%- __html %>
79+
// res.render('notFound', markItUp(mark));
80+
res.render('item', matches[0]);;
7381
});
7482
});
7583

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"express-session": "^1.15.5",
2222
"googleapis": "^21.3.0",
2323
"jquery": "^3.2.1",
24+
"marked": "^0.3.7",
2425
"qr-image": "^3.2.0",
2526
"url-regex": "^4.1.1",
2627
"uuid-regexp": "^0.3.0"

views/notFound.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<img class="col-xs-12 col-lg-4 col-lg-offset-4" src="/emoji.png" alt="" />
44
<article style='margin-top:2em'class="col-xs-12 col-lg-4 col-lg-offset-4">
5-
<p>Sorry, item not found with the id:</p>
5+
<p>Sorry, item not found with the id: </p>
66
<p>
7-
<strong><%= id %></strong>
7+
<strong><%- id %></strong>
88
</p>
99
</article>
1010

views/partials/itemImgInfo.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
<a href="/<%- similarItems[i].uuid %>"> <img class="miniItemImg" src=" <%- similarItems[i].picture %> " /> </a>
2929
<%} %>
3030
<% } %>
31-
</div>
31+
</d
32+
iv>
3233
<% } %>
3334
</article>
3435
<%}%>

0 commit comments

Comments
 (0)