@ecency/render-helper 2.2.29 → 2.2.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecency/render-helper",
3
- "version": "2.2.29",
3
+ "version": "2.2.31",
4
4
  "description": "Markdown+Html Render helper",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -812,7 +812,7 @@ describe('Markdown2Html', () => {
812
812
  author: 'foo358',
813
813
  permlink: 'bar358',
814
814
  last_update: '2021-08-18T09:15:49',
815
- body: `<p><strong>It's a Secret, But is it good to have secrets?</strong><br>
815
+ body: `<p><strong>It's a Secret, But is it good to have secrets?</strong><br>
816
816
  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 </p> `
817
817
  }
818
818
  const expected = '<p><strong>It\'s a Secret, But is it good to have secrets?</strong><br /><a data-tag=\"hive-123046\" data-author=\"ecotrain\" data-permlink=\"ecotrain-question-of-the-week-season-5-1tie-up-post-it-s-a-secret-but-is-it-good-to-have-secrets\" class=\"markdown-post-link\">/@ecotrain/ecotrain-question-of-the-week-season-5-1tie-up-post-it-s-a-secret-but-is-it-good-to-have-secrets</a></p>'
@@ -938,6 +938,18 @@ describe('Markdown2Html', () => {
938
938
 
939
939
  expect(markdown2Html(input, false)).toBe(expected)
940
940
  })
941
+
942
+ it('69 - Should handle section links', () => {
943
+ const input = {
944
+ author: 'foo369',
945
+ permlink: 'bar369',
946
+ last_update: '2019-05-10T09:15:21',
947
+ body: 'this is link https://inleo.io/@godfish/close-range-reflections'
948
+ }
949
+ const expected = '<p>this is link <a href="/post/@godfish/close-range-reflections" class="markdown-post-link">@godfish/close-range-reflections</a></p>'
950
+
951
+ expect(markdown2Html(input, false)).toBe(expected)
952
+ })
941
953
  })
942
954
 
943
955
  describe("Rumble support", () => {
@@ -4,9 +4,11 @@ export function cleanReply(s: string): string {
4
4
  .filter(item => item.toLowerCase().includes('posted using [dapplr') === false)
5
5
  .filter(item => item.toLowerCase().includes('posted using [leofinance') === false)
6
6
  .filter(item => item.toLowerCase().includes('posted via [neoxian') === false)
7
+ .filter(item => item.toLowerCase().includes('posted using [neoxian') === false)
7
8
  .filter(item => item.toLowerCase().includes('posted with [stemgeeks') === false)
8
9
  .filter(item => item.toLowerCase().includes('posted using [bilpcoin') === false)
9
10
  .filter(item => item.toLowerCase().includes('posted using [inleo') === false)
11
+ .filter(item => item.toLowerCase().includes('posted using [sportstalksocial]') === false)
10
12
  .filter(item => item.toLowerCase().includes('<center><sub>[posted using aeneas.blog') === false)
11
13
  .filter(item => item.toLowerCase().includes('<center><sub>posted via [proofofbrain.io') === false)
12
14
  .filter(item => item.toLowerCase().includes('<center>posted on [hypnochain') === false)
@@ -24,4 +26,5 @@ export function cleanReply(s: string): string {
24
26
  .join('\n') : '')
25
27
  .replace('Posted via <a href="https://d.buzz" data-link="promote-link">D.Buzz</a>', '')
26
28
  .replace('<div class="pull-right"><a href="/@hive.engage">![](https://i.imgur.com/XsrNmcl.png)</a></div>', '')
29
+ .replace('<div><a href="https://engage.hivechain.app">![](https://i.imgur.com/XsrNmcl.png)</a></div>', '')
27
30
  }
@@ -13,6 +13,9 @@ export function markdownToHTML(input: string, forApp: boolean, webp: boolean): s
13
13
  input = input.replace(new RegExp("https://leofinance.io/threads/view/","g"), "/@");
14
14
  input = input.replace(new RegExp("https://leofinance.io/posts/","g"), "/@");
15
15
  input = input.replace(new RegExp("https://leofinance.io/threads/","g"), "/@");
16
+ input = input.replace(new RegExp("https://inleo.io/threads/view/","g"), "/@");
17
+ input = input.replace(new RegExp("https://inleo.io/posts/","g"), "/@");
18
+ input = input.replace(new RegExp("https://inleo.io/threads/","g"), "/@");
16
19
 
17
20
 
18
21
  const md = new Remarkable({