chore(doc-gen): don't use `string` module to stripTags

This module writes a file called `string` containing the text `testtest`
to the file system when it initialize.

See https://github.com/arturadib/shelljs/issues/212
This commit is contained in:
Peter Bacon Darwin 2015-07-09 11:40:09 -07:00
parent 0e28297e68
commit 927454c8fa
1 changed files with 6 additions and 2 deletions

View File

@ -2,7 +2,11 @@ var marked = require('marked');
var Encoder = require('node-html-encoder').Encoder;
var html2jade = require('html2jade');
var indentString = require('indent-string');
var S = require('string');
function stripTags(s) { //from sugar.js
return s.replace(RegExp('<\/?[^<>]*>', 'gi'), '');
}
// entity type encoder
var encoder = new Encoder('entity');
@ -35,7 +39,7 @@ module.exports = function renderMarkdown(trimIndentation) {
renderer.heading = function (text, level, raw) {
var headingText = marked.Renderer.prototype.heading.call(renderer, text, level, raw);
var title = 'h2 ' + S(headingText).stripTags().s;
var title = 'h2 ' + stripTags(headingText);
if (level==2) {
title = '.l-main-section\n' + indentString(title, ' ', 2) ;