stripBlankLines.js 385 B

1234567891011121314
  1. /**
  2. * Created by Estevao on 11-01-2015.
  3. */
  4. /**
  5. * Strip any lines consisting only of spaces and tabs.
  6. * This makes subsequent regexs easier to write, because we can
  7. * match consecutive blank lines with /\n+/ instead of something
  8. * contorted like /[ \t]*\n+/
  9. */
  10. showdown.subParser('stripBlankLines', function (text) {
  11. 'use strict';
  12. return text.replace(/^[ \t]+$/mg, '');
  13. });