Skip to content

Commit

Permalink
ignore older internal links
Browse files Browse the repository at this point in the history
  • Loading branch information
feruzm committed Aug 18, 2023
1 parent 4cbed43 commit 8fcf099
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
27 changes: 15 additions & 12 deletions src/consts/white-list.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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'
]
6 changes: 3 additions & 3 deletions src/methods/markdown-to-html.method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 8fcf099

Please sign in to comment.