Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes HTML tags from feed titles #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var express = require('express'); // call express
var app = express(); // define our app using express
var bodyParser = require('body-parser');
var request = require('request');
var striptags = require('striptags');
var url = require('url');
var _ = require('lodash');

Expand All @@ -33,7 +34,8 @@ router.get('/dsd/code-enforcement', function(req, res) {
// Change fields based on permit type. Need to make flexible for other OpenDSD types, also, need
// to understand what the "Case Depiction" field actually does.

var titleString = "There's been a code enforcement case updated near you at: " +element.StreetAddress+".<br/> The violation is "+ element.Description +".<br/> You can find out more at: http://opendsd.sandiego.gov/web/CECases/Details/"+ element.CaseId
var titleString = "There's been a code enforcement case updated near you at: " +element.StreetAddress+".<br/> The violation is "+ element.Description +".<br/> You can find out more at: http://opendsd.sandiego.gov/web/CECases/Details/"+ element.CaseId;
titleString = striptags(titleString);

var feature = {
id: element.caseId,
Expand Down Expand Up @@ -74,6 +76,7 @@ router.get('/dsd/approvals', function(req, res) {
// to understand what the "Case Depiction" field actually does.

var titleString = element.ApprovalType+" approval for project \"" +element.ProjectTitle+"\".<br/> You can find out more at: http://opendsd.sandiego.gov/web/Approvals/Details/"+element.ApprovalId
titleString = striptags(titleString);

var feature = {
id: element.caseId,
Expand Down
1 change: 0 additions & 1 deletion app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var superagent = require('superagent')
var expect = require('expect.js')
var Agent = require('agentkeepalive')


describe('openDSD fetching', function() {
it('retrieves a collection', function(done){
superagent.get('http://localhost:8080/')
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lodash": "~3.9.3",
"mocha": "2.0.1",
"request": "^2.58.0",
"striptags": "^2.1.1",
"superagent": "0.20.0"
},
"scripts": {
Expand Down