turndown.es.js.patch 841 B

123456789101112131415161718192021
  1. --- a/node_modules/turndown/lib/turndown.es.js 2018-04-29 10:24:58.000000000 +0000
  2. +++ b/node_modules/turndown/lib/turndown.es.js 2018-07-09 12:51:04.276160261 +0000
  3. @@ -53,6 +53,9 @@
  4. filter: 'br',
  5. replacement: function (content, node, options) {
  6. + if (node.previousElementSibling && node.previousElementSibling.nodeName === 'BR') {
  7. + return options.br + '\\\n'
  8. + }
  9. return options.br + '\n'
  10. }
  11. };
  12. @@ -110,7 +113,7 @@
  13. if (parent.nodeName === 'OL') {
  14. var start = parent.getAttribute('start');
  15. var index = Array.prototype.indexOf.call(parent.children, node);
  16. - prefix = (start ? Number(start) + index : index + 1) + '. ';
  17. + prefix = (start ? Number(start) + index : index + 1) + '. ';
  18. }
  19. return (
  20. prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '')