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:
parent
0e28297e68
commit
927454c8fa
|
@ -2,7 +2,11 @@ var marked = require('marked');
|
||||||
var Encoder = require('node-html-encoder').Encoder;
|
var Encoder = require('node-html-encoder').Encoder;
|
||||||
var html2jade = require('html2jade');
|
var html2jade = require('html2jade');
|
||||||
var indentString = require('indent-string');
|
var indentString = require('indent-string');
|
||||||
var S = require('string');
|
|
||||||
|
|
||||||
|
function stripTags(s) { //from sugar.js
|
||||||
|
return s.replace(RegExp('<\/?[^<>]*>', 'gi'), '');
|
||||||
|
}
|
||||||
|
|
||||||
// entity type encoder
|
// entity type encoder
|
||||||
var encoder = new Encoder('entity');
|
var encoder = new Encoder('entity');
|
||||||
|
@ -35,7 +39,7 @@ module.exports = function renderMarkdown(trimIndentation) {
|
||||||
|
|
||||||
renderer.heading = function (text, level, raw) {
|
renderer.heading = function (text, level, raw) {
|
||||||
var headingText = marked.Renderer.prototype.heading.call(renderer, 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) {
|
if (level==2) {
|
||||||
title = '.l-main-section\n' + indentString(title, ' ', 2) ;
|
title = '.l-main-section\n' + indentString(title, ' ', 2) ;
|
||||||
|
|
Loading…
Reference in New Issue