diff --git a/package.json b/package.json index f0f4f01..f85b1cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ecency/render-helper", - "version": "2.2.29", + "version": "2.2.30", "description": "Markdown+Html Render helper", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/markdown-2-html.spec.ts b/src/markdown-2-html.spec.ts index f776959..93a319d 100644 --- a/src/markdown-2-html.spec.ts +++ b/src/markdown-2-html.spec.ts @@ -812,7 +812,7 @@ describe('Markdown2Html', () => { author: 'foo358', permlink: 'bar358', last_update: '2021-08-18T09:15:49', - body: `

It's a Secret, But is it good to have secrets?
+ body: `

It's a Secret, But is it good to have secrets?
https://peakd.com/hive-123046/@ecotrain/ecotrain-question-of-the-week-season-5-1tie-up-post-it-s-a-secret-but-is-it-good-to-have-secrets

` } const expected = '

It\'s a Secret, But is it good to have secrets?
/@ecotrain/ecotrain-question-of-the-week-season-5-1tie-up-post-it-s-a-secret-but-is-it-good-to-have-secrets

' @@ -938,6 +938,18 @@ describe('Markdown2Html', () => { expect(markdown2Html(input, false)).toBe(expected) }) + + it('69 - Should handle section links', () => { + const input = { + author: 'foo369', + permlink: 'bar369', + last_update: '2019-05-10T09:15:21', + body: 'this is link https://inleo.io/@godfish/close-range-reflections' + } + const expected = '

this is link @godfish/close-range-reflections

' + + expect(markdown2Html(input, false)).toBe(expected) + }) }) describe("Rumble support", () => { diff --git a/src/methods/clean-reply.method.ts b/src/methods/clean-reply.method.ts index b3d4578..189c6b0 100644 --- a/src/methods/clean-reply.method.ts +++ b/src/methods/clean-reply.method.ts @@ -7,6 +7,7 @@ export function cleanReply(s: string): string { .filter(item => item.toLowerCase().includes('posted with [stemgeeks') === false) .filter(item => item.toLowerCase().includes('posted using [bilpcoin') === false) .filter(item => item.toLowerCase().includes('posted using [inleo') === false) + .filter(item => item.toLowerCase().includes('posted using [sportstalksocial]') === false) .filter(item => item.toLowerCase().includes('
[posted using aeneas.blog') === false) .filter(item => item.toLowerCase().includes('
posted via [proofofbrain.io') === false) .filter(item => item.toLowerCase().includes('
posted on [hypnochain') === false) @@ -24,4 +25,5 @@ export function cleanReply(s: string): string { .join('\n') : '') .replace('Posted via D.Buzz', '') .replace('', '') + .replace('', '') } diff --git a/src/methods/markdown-to-html.method.ts b/src/methods/markdown-to-html.method.ts index 8eda564..02ff13c 100644 --- a/src/methods/markdown-to-html.method.ts +++ b/src/methods/markdown-to-html.method.ts @@ -13,6 +13,9 @@ export function markdownToHTML(input: string, forApp: boolean, webp: boolean): s 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"), "/@"); + input = input.replace(new RegExp("https://inleo.io/threads/view/","g"), "/@"); + input = input.replace(new RegExp("https://inleo.io/posts/","g"), "/@"); + input = input.replace(new RegExp("https://inleo.io/threads/","g"), "/@"); const md = new Remarkable({