Skip to content

Commit

Permalink
Make Youtube link clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
tpmai22 committed Jan 30, 2022
1 parent 77e5d50 commit 4d58418
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/api/posts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"ioredis": "4.28.2",
"ioredis-mock": "5.8.1",
"jsdom": "18.1.1",
"linkify-html": "^3.0.5",
"linkifyjs": "^3.0.5",
"normalize-url": "6.1.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/api/posts/src/data/post.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { hash } = require('@senecacdot/satellite');
const linkifyHtml = require('linkify-html');
const { getPost, addPost } = require('../storage');
const Feed = require('./feed');
const textParser = require('../text-parser');
Expand Down Expand Up @@ -59,7 +60,7 @@ class Post {
// Use the post's guid as our unique identifier
this.id = hash(guid);
this.title = title;
this.html = html;
this.html = linkifyHtml(html);
this.published = ensureDate(datePublished);
this.updated = ensureDate(dateUpdated, datePublished);
// create an absolute url if postURL is relative
Expand Down

0 comments on commit 4d58418

Please sign in to comment.