Added a filter for any \r's or \n's

This commit is contained in:
Bram van der Veen 2015-06-19 21:10:58 +02:00
parent 74e5c6bcb9
commit 298f5d5615
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@ div.schedule
div.hour.title
span= days[match.json.indexOf(day)]
each hour in day
if hour.teacher != 'vrij\r' && hour.teacher != 'vrij'
if hour.teacher != 'vrij'
div.hour(class=hour.changed == 'true' ? 'changed' : '')
each subhour in hour.teacher
span.teacher(class='sub_' + hour.teacher.length)

View file

@ -51,7 +51,7 @@ function to_json(page) {
for (subhour = 0; subhour < amount_of_special_hours; subhour++) {
var selected_hour = schedule.find('table').eq(day).find('tr').eq(subhour).find('td');
//Give the value of the schedule hour to the fitting array.
schedule_data[day][hour].teacher[subhour] = selected_hour.eq(0).text();
schedule_data[day][hour].teacher[subhour] = selected_hour.eq(0).text().replace(/\r|\n/g, '');
schedule_data[day][hour].chamber[subhour] = selected_hour.eq(2).text();
schedule_data[day][hour].course[subhour] = selected_hour.eq(4).text();
//Check if the hour is 'changed' by the schedule authors, if so set to true.