Skip to content

Commit 08c347e

Browse files
committed
remove html but leave newlines in the job cleaning
1 parent c6fc5c2 commit 08c347e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

source/views/sis/student-work/clean-job.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
// @flow
22
import type {JobType} from './types'
33

4-
import {fastGetTrimmedText} from '../../../lib/html'
4+
import {
5+
fastGetTrimmedText,
6+
removeHtmlWithRegex,
7+
} from '../../../lib/html'
58

69
export function cleanJob(job: JobType): JobType {
710
const title = fastGetTrimmedText(job.title)
8-
const description = fastGetTrimmedText(job.description)
911
const office = fastGetTrimmedText(job.office)
1012
const type = fastGetTrimmedText(job.type)
11-
const comments = fastGetTrimmedText(job.comments)
12-
const skills = fastGetTrimmedText(job.skills)
13+
14+
// these all need to retain their newlines
15+
const description = removeHtmlWithRegex(job.description).replace('\t', ' ')
16+
const comments = removeHtmlWithRegex(job.comments).replace('\t', ' ')
17+
const skills = removeHtmlWithRegex(job.skills).replace('\t', ' ')
1318

1419
const hoursPerWeek = job.hoursPerWeek.trim()
1520
const lastModified = job.lastModified.trim()

0 commit comments

Comments
 (0)