turndown.cjs.js.patch 843 B

123456789101112131415161718192021
  1. --- a/node_modules/turndown/lib/turndown.cjs.js 2018-04-29 10:24:56.000000000 +0000
  2. +++ b/node_modules/turndown/lib/turndown.cjs.js 2018-07-09 12:49:49.405574937 +0000
  3. @@ -55,6 +55,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. @@ -112,7 +115,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' : '')