blog2md icon indicating copy to clipboard operation
blog2md copied to clipboard

html table support

Open Eucaly opened this issue 4 years ago • 1 comments

Nice program !!

In case, for those who might look for html table support

  • yarn add turndown-plugin-gfm , or
  • npm i --save turndown-plugin-gfm
  • add below code (2 lines, noted by >>) in index.js, about line 15
>> const tables = require('turndown-plugin-gfm').tables;
const TurndownService = require('turndown');

var tds = new TurndownService({ codeBlockStyle: 'fenced', fence: '```' })
>> tds.use(tables);

=> reference here, https://github.com/domchristie/turndown-plugin-gfm#usage


In addition to that, I like the output files (from blogger) to be organized in folder structure as 2019/12/filename.md Below is the patch, (might not suit everyone need.)

//: line 304
/* delete */ var fname = outputDir + '/' + path.basename(url);
/* add */ var fname = outputDir + '/' + url.substr(url.indexOf(".com")+5);

// line 438
function writeToFile(filename, content, append=false){

>>  let f = path.parse(filename);
>>  if (!fs.existsSync(f.dir))
>>      fs.mkdirSync(f.dir, {recursive: true});

Eucaly avatar May 30 '20 11:05 Eucaly

Thanks for you contribution. Leaving the ticket open, if anyone find this useful.

palaniraja avatar May 30 '20 15:05 palaniraja