Skip to content

Commit

Permalink
chore(frontend): render posts using interweave library
Browse files Browse the repository at this point in the history
- Use the interweave library to render posts so we're not dangerously
  settings inner HTMLs.
  • Loading branch information
jerroydmoore committed Jan 3, 2020
1 parent beadf95 commit b567ad0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions frontend/package-lock.json

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

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"gatsby-plugin-sharp": "^2.3.5",
"gatsby-source-filesystem": "^2.1.40",
"gatsby-transformer-sharp": "^2.3.7",
"interweave": "^12.1.1",
"placeholder-loading": "^0.2.4",
"prop-types": "^15.7.2",
"query-string": "^6.9.0",
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/jobPost.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Card } from 'react-bootstrap';
import { Markup } from 'interweave';

const JobPost = ({ job }) => {
const endOfTitle = job.body.indexOf('<p>');
Expand All @@ -9,10 +10,10 @@ const JobPost = ({ job }) => {
<Card className="job-posting">
<Card.Body>
<Card.Title>
<div dangerouslySetInnerHTML={{ __html: title }}></div>
<Markup content={title} />
</Card.Title>
<Card.Text>
<div dangerouslySetInnerHTML={{ __html: body }}></div>
<Markup content={body} />
<small className="authorship">
Posted on{' '}
<a
Expand Down

0 comments on commit b567ad0

Please sign in to comment.