From 9949893bf042d9df5c2c0ae201c0c80b589b28e7 Mon Sep 17 00:00:00 2001 From: imfunny <36105478+imfunniee@users.noreply.github.com> Date: Fri, 10 May 2019 12:38:05 +0530 Subject: [PATCH] fixed emoji issue emoijs weren't showing up if description of repo or bio had more than one emoji + if the emoji was missing from github-emoji --- blog.js | 2 +- build.js | 20 ++++++++++++++------ package-lock.json | 2 +- package.json | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/blog.js b/blog.js index a3800a6..f44162b 100644 --- a/blog.js +++ b/blog.js @@ -6,7 +6,7 @@ options = { }; program - .version('0.1.1') + .version('0.1.2') .option('-t, --title [title]', 'give blog a title') .option('-s, --subtitle [subtitle]', 'give blog a subtitle', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.') .option('-p, --pagetitle [pagetitle]', 'give page a title') diff --git a/build.js b/build.js index c04e69e..ad4b281 100644 --- a/build.js +++ b/build.js @@ -8,7 +8,7 @@ options = { }; program - .version('0.1.1') + .version('0.1.2') .option('-n, --name [username]', 'get username') .option('-d, --dark', 'enable dark mode') .option('-b, --background [background]', 'set background image') @@ -47,14 +47,22 @@ if (program.background) { populateCSS(); } + function convertToEmoji(text){ if (text == null) return; text = text.toString(); - if(text.match(/\:(.*)\:/) != null){ - var str = text.match(/\:(.*)\:/)[1]; - var output = emoji.of(str); - var emojiImage = output.url.replace("assets-cdn.github", "github.githubassets"); - text = text.replace(/\:(.*)\:/, ``); + if(text.match(/(?<=:\s*).*?(?=\s*:)/gs) != null){ + var str = text.match(/(?<=:\s*).*?(?=\s*:)/gs); + str = str.filter(function(arr) { + return /\S/.test(arr); + }); + for(i=0;i`); + } + } return text; }else{ return text; diff --git a/package-lock.json b/package-lock.json index 8f154df..f09eb7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gitfolio", - "version": "1.0.0", + "version": "0.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 488b2ca..2faba7d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gitfolio", - "version": "0.1.1", + "version": "0.1.2", "description": "portfolio website for showcasing your work", "main": "build.js", "scripts": {