Skip to content

Commit

Permalink
Merge pull request #11 from bit-docs/10-fix-tag-stripping
Browse files Browse the repository at this point in the history
Fix tag stripping. Fixes #10
  • Loading branch information
imaustink authored Jun 20, 2017
2 parents fb018ba + 156ccbc commit 981a872
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions generators/search-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var fs = require('fs'),
Q = require('q'),
writeFile = Q.denodeify(fs.writeFile),
mkdirs = Q.denodeify(require("fs-extra").mkdirs),
unescapeHTML = require("unescape-html"),
striptags = require("striptags"),
helpers = require('bit-docs-generate-html/build/make_default_helpers')({}, {}, function(){}, {});

/**
Expand All @@ -26,8 +26,12 @@ module.exports = function(docMap, siteConfig) {
if (docMap.hasOwnProperty(name)) {
var docObj = docMap[name];

var description = helpers.stripMarkdown(docObj.description);
description = unescapeHTML(description);
var description = helpers.makeHtml(docObj.description);
description = helpers.makeLinks(description);
description = striptags(description,
// Allowed tags
['a', 'em', 'code']
);

var searchObj = {
name: docObj.name,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lodash": "~4.13.1",
"md5": "2.1.0",
"steal-tools": "0.16.X",
"unescape-html": "^1.0.0"
"striptags": "^3.0.1"
},
"devDependencies": {
"mocha": ">= 1.18.0",
Expand Down
4 changes: 2 additions & 2 deletions test.js

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

0 comments on commit 981a872

Please sign in to comment.