mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-29 22:07:46 +03:00
processing anchored post link
This commit is contained in:
parent
487d5f1217
commit
58b6fa8183
@ -35,6 +35,14 @@ export const parseLinkData = (tnode:TNode):LinkData => {
|
||||
if (tnode.classes.includes('markdown-post-link')) {
|
||||
var author = tnode.attributes['data-author'];
|
||||
var permlink = tnode.attributes['data-permlink'];
|
||||
|
||||
const childAnchorIndex = permlink.indexOf('#@');
|
||||
if(childAnchorIndex > 0){
|
||||
const childLink = permlink.substring(childAnchorIndex + 2);
|
||||
const separatorIndex = childLink.indexOf('/');
|
||||
author = childLink.substring(0, separatorIndex);
|
||||
permlink = childLink.substring(separatorIndex + 1);
|
||||
}
|
||||
return {
|
||||
type: 'markdown-post-link',
|
||||
author: author,
|
||||
|
Loading…
Reference in New Issue
Block a user