Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Commit 8e7b33e

Browse files
committed
fix inline links
1 parent 54296a5 commit 8e7b33e

6 files changed

Lines changed: 13 additions & 5 deletions

File tree

lib/methods/a.method.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/methods/a.method.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/render-helper.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ecency/render-helper",
3-
"version": "2.3.9",
3+
"version": "2.3.10",
44
"description": "Markdown+Html Render helper",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/markdown-2-html.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ describe('Markdown2Html', () => {
946946
last_update: '2019-05-10T09:15:21',
947947
body: 'this is link https://inleo.io/@godfish/close-range-reflections'
948948
}
949-
const expected = '<p dir=\"auto\">this is link <a href="/post/@godfish/close-range-reflections" class="markdown-post-link">@godfish/close-range-reflections</a></p>'
949+
const expected = '<p dir=\"auto\">this is link <a href="/post/@godfish/close-range-reflections" class="markdown-post-link" data-is-inline="false">@godfish/close-range-reflections</a></p>'
950950

951951
expect(markdown2Html(input, false)).toBe(expected)
952952
})
@@ -1161,7 +1161,7 @@ describe('Markdown2Html', () => {
11611161
last_update: '2019-05-10T09:15:21',
11621162
body: 'https://img.esteem.ws/bbq3ob1idy.png <a href="https://steemit.com/esteem/@esteemapp/esteem-monthly-guest-curation-program-4">fooo</a> <a href="/esteem/@esteemapp/esteem-monthly-guest-curation-program-4">bar</a> <a href="http://external.com/loromoro">baz</a> #lorem @ipsum <a href=\'https://steemit.com/~witnesses\'>vote me</a>'
11631163
}
1164-
const expected = '<p dir=\"auto\"><img class="markdown-img-link" src="https://images.ecency.com/p/o1AJ9qDyyJNSpZWhUgGYc3MngFqoAMwgbeMkkd8SVxyfRVjiN.png?format=match&amp;mode=fit" loading="lazy" decoding="async" itemprop="image" /> <a href="https://steemit.com/esteem/@esteemapp/esteem-monthly-guest-curation-program-4" class="markdown-external-link" target="_blank" rel="noopener">fooo</a> <a href="/esteem/@esteemapp/esteem-monthly-guest-curation-program-4" class="markdown-post-link">bar</a> <a href="http://external.com/loromoro" class="markdown-external-link" target="_blank" rel="noopener">baz</a><span> <a class="markdown-tag-link" href="/trending/lorem">#lorem</a> <a class="markdown-author-link" href="/@ipsum">@ipsum</a> </span><a href="https://steemit.com/~witnesses" class="markdown-external-link" target="_blank" rel="noopener">vote me</a></p>'
1164+
const expected = '<p dir=\"auto\"><img class="markdown-img-link" src="https://images.ecency.com/p/o1AJ9qDyyJNSpZWhUgGYc3MngFqoAMwgbeMkkd8SVxyfRVjiN.png?format=match&amp;mode=fit" loading="lazy" decoding="async" itemprop="image" /> <a href="https://steemit.com/esteem/@esteemapp/esteem-monthly-guest-curation-program-4" class="markdown-external-link" target="_blank" rel="noopener">fooo</a> <a href="/esteem/@esteemapp/esteem-monthly-guest-curation-program-4" class="markdown-post-link" data-is-inline="true">bar</a> <a href="http://external.com/loromoro" class="markdown-external-link" target="_blank" rel="noopener">baz</a><span> <a class="markdown-tag-link" href="/trending/lorem">#lorem</a> <a class="markdown-author-link" href="/@ipsum">@ipsum</a> </span><a href="https://steemit.com/~witnesses" class="markdown-external-link" target="_blank" rel="noopener">vote me</a></p>'
11651165

11661166
expect(markdown2Html(input, false)).toBe(expected)
11671167
})

src/methods/a.method.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export function a(el: HTMLElement, forApp: boolean, webp: boolean): void {
121121
} else {
122122
const h = `/${tag}/@${author}/${permlink}`
123123
el.setAttribute('href', h)
124+
el.setAttribute('data-is-inline', '' + isInline)
124125
}
125126
return
126127
}
@@ -208,6 +209,7 @@ export function a(el: HTMLElement, forApp: boolean, webp: boolean): void {
208209
} else {
209210
const h = `/${tag}/@${author}/${permlink}`
210211
el.setAttribute('href', h)
212+
el.setAttribute('data-is-inline', '' + isInline)
211213
}
212214

213215
return
@@ -286,6 +288,7 @@ export function a(el: HTMLElement, forApp: boolean, webp: boolean): void {
286288
} else {
287289
const h = `/${tag}/@${author}/${permlink}`
288290
el.setAttribute('href', h)
291+
el.setAttribute('data-is-inline', '' + isInline)
289292
}
290293

291294
return
@@ -391,6 +394,7 @@ export function a(el: HTMLElement, forApp: boolean, webp: boolean): void {
391394
} else {
392395
const h = `/${tag}/@${author}/${permlink}`
393396
el.setAttribute('href', h)
397+
el.setAttribute('data-is-inline', '' + isInline)
394398
}
395399
return
396400
}

0 commit comments

Comments
 (0)