mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-25 14:22:14 +03:00
fix if link has comment parts
This commit is contained in:
parent
81170e05b6
commit
d15d998f5c
@ -101,6 +101,14 @@ export default (url) => {
|
|||||||
// For non urls with category like esteem/@good-karma/esteem-london-presentation-e3105ba6637ed
|
// For non urls with category like esteem/@good-karma/esteem-london-presentation-e3105ba6637ed
|
||||||
match = url.match(/([\w.\d-]+)\/(@[\w.\d-]+)\/(.*)/);
|
match = url.match(/([\w.\d-]+)\/(@[\w.\d-]+)\/(.*)/);
|
||||||
if (match && match.length === 4) {
|
if (match && match.length === 4) {
|
||||||
|
if (match[3].indexOf('#') > -1) {
|
||||||
|
const commentPart = match[3].split('@')[1];
|
||||||
|
return {
|
||||||
|
category: match[1],
|
||||||
|
author: commentPart.split('/')[0],
|
||||||
|
permlink: commentPart.split('/')[1],
|
||||||
|
};
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
category: match[1],
|
category: match[1],
|
||||||
author: match[2].replace('@', ''),
|
author: match[2].replace('@', ''),
|
||||||
|
Loading…
Reference in New Issue
Block a user