diff --git a/package.json b/package.json index 075544d..3152032 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ecency/render-helper", - "version": "2.2.25", + "version": "2.2.26", "description": "Markdown+Html Render helper", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/consts/white-list.const.ts b/src/consts/white-list.const.ts index 5822067..5a01d8e 100644 --- a/src/consts/white-list.const.ts +++ b/src/consts/white-list.const.ts @@ -2,6 +2,20 @@ export const WHITE_LIST = [ 'ecency.com', 'hive.blog', 'peakd.com', + 'travelfeed.io', + 'dapplr.in', + 'leofinance.io', + 'proofofbrain.io', + 'stemgeeks.net', + 'hiveblockexplorer.com', + 'proofofbrain.blog', + 'weedcash.network', + 'dapplr.in', + 'liketu.com', + 'bilpcoin.com', + 'inji.com' +] +export const OLD_LIST = [ 'busy.org', 'steemit.com', 'esteem.app', @@ -12,18 +26,7 @@ export const WHITE_LIST = [ 'steemkr.com', 'strimi.pl', 'steemhunt.com', - 'travelfeed.io', 'ulogs.org', 'hede.io', - 'weedcash.network', - 'dapplr.in', - 'leofinance.io', - 'proofofbrain.io', - 'naturalmedicine.io', - 'bilpcoin.com', - 'stemgeeks.net', - 'hiveblockexplorer.com', - 'proofofbrain.blog', - 'liketu.com', - 'inji.com' + 'naturalmedicine.io' ] diff --git a/src/methods/markdown-to-html.method.ts b/src/methods/markdown-to-html.method.ts index 5057c1d..8eda564 100644 --- a/src/methods/markdown-to-html.method.ts +++ b/src/methods/markdown-to-html.method.ts @@ -10,9 +10,9 @@ const { linkify } = require('remarkable/linkify') export function markdownToHTML(input: string, forApp: boolean, webp: boolean): string { // Internalize leofinance.io links - input = input.replace("https://leofinance.io/threads/view/", "/@"); - input = input.replace("https://leofinance.io/posts/", "/@"); - input = input.replace("https://leofinance.io/threads/", "/@"); + input = input.replace(new RegExp("https://leofinance.io/threads/view/","g"), "/@"); + input = input.replace(new RegExp("https://leofinance.io/posts/","g"), "/@"); + input = input.replace(new RegExp("https://leofinance.io/threads/","g"), "/@"); const md = new Remarkable({