showdown/src/subParsers/stripBlankLines.js

11 lines
339 B
JavaScript
Raw Normal View History

2015-01-16 05:21:33 +08:00
/**
* Strip any lines consisting only of spaces and tabs.
* This makes subsequent regexs easier to write, because we can
* match consecutive blank lines with /\n+/ instead of something
* contorted like /[ \t]*\n+/
*/
showdown.subParser('stripBlankLines', function (text) {
2015-01-19 19:37:21 +08:00
'use strict';
return text.replace(/^[ \t]+$/mg, '');
2015-01-16 05:21:33 +08:00
});