Skip to content

Instantly share code, notes, and snippets.

@SunnyBingoMe
Last active May 4, 2016 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SunnyBingoMe/f74589ef688c0eed962314fdb61a1576 to your computer and use it in GitHub Desktop.
Save SunnyBingoMe/f74589ef688c0eed962314fdb61a1576 to your computer and use it in GitHub Desktop.
// hexo\node_modules\hexo-migrator-wordpress\node_modules\to-markdown\src\to-markdown.js: line 70
{
patterns: 'img',
type: 'void',
replacement: function(str, attrs, innerHTML) {
var src = attrs.match(attrRegExp('src')),
alt = attrs.match(attrRegExp('alt')),
title = attrs.match(attrRegExp('title'));
// after line 70. hot-fix: add this if-statement
if (src == null){
src = "_img_src_error_";
}
return '![' + (alt && alt[1] ? alt[1] : '') + ']' + '(' + src[1] + (title && title[1] ? ' "' + title[1] + '"' : '') + ')';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment