mirror of
https://github.com/System-End/site.git
synced 2026-04-19 16:28:21 +00:00
decode HTML entities in Polymer jobs (#1830)
* decode HTML entities in Polymer jobs * <, right...
This commit is contained in:
parent
83b5f9e712
commit
0cb03cb86e
2 changed files with 10 additions and 1 deletions
|
|
@ -187,3 +187,11 @@ export const normalizeGitHubCommitUrl = url => {
|
||||||
.replace('/repos', '')
|
.replace('/repos', '')
|
||||||
.replace('commits', 'commit')
|
.replace('commits', 'commit')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const decodeHtmlEntities = str =>
|
||||||
|
str
|
||||||
|
?.replace(/</g, '<')
|
||||||
|
.replace(/>/g, '>')
|
||||||
|
.replace(/"/g, '"')
|
||||||
|
.replace(/'/g, "'")
|
||||||
|
.replace(/&/g, '&')
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import Icon from '../../components/icon'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import zephyrPic from '../../public/jobs/zephyr-group-pic.jpg'
|
import zephyrPic from '../../public/jobs/zephyr-group-pic.jpg'
|
||||||
import { compact } from 'lodash'
|
import { compact } from 'lodash'
|
||||||
|
import { decodeHtmlEntities } from '../../lib/helpers'
|
||||||
|
|
||||||
const JobListing = ({
|
const JobListing = ({
|
||||||
positionName,
|
positionName,
|
||||||
|
|
@ -156,7 +157,7 @@ const Page = ({ jobs }) => (
|
||||||
jobs.items.map(job => (
|
jobs.items.map(job => (
|
||||||
<JobListing
|
<JobListing
|
||||||
key={job.id}
|
key={job.id}
|
||||||
positionName={job.title}
|
positionName={decodeHtmlEntities(job.title)}
|
||||||
positionDesc={job.job_category_name}
|
positionDesc={job.job_category_name}
|
||||||
positionLink={job.job_post_url}
|
positionLink={job.job_post_url}
|
||||||
positionLocation={job.display_location}
|
positionLocation={job.display_location}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue