Created
March 30, 2016 00:44
-
-
Save whitfin/7a5172da4e62b231745e66fd0f094d62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.parse = function parse(mdown) { | |
console.log('<p align="center" style="margin: 2em auto auto auto; width:70%;">'); | |
mdown.match(/\[\!.*?\)\].*?\)/g).forEach(function (badge) { | |
var segments = badge.match(/\[!\[(.*?)\]\((.*?)\)\]\((.*?)\)/); | |
var altText = segments[1]; | |
var svgPath = segments[2]; | |
var urlHref = segments[3]; | |
console.log(` <a href="${urlHref}">`); | |
console.log(` <img src="${svgPath}" alt="${altText}" />`); | |
console.log(` </a>`); | |
}); | |
console.log('</p>') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment