mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 05:13:04 +03:00
added support to handle markdown-community-link
This commit is contained in:
parent
43d9d324ef
commit
5bb58eb42f
@ -9,6 +9,7 @@ export interface LinkData {
|
||||
proposal?:string,
|
||||
videoHref?:string,
|
||||
filter?:string,
|
||||
community?:string,
|
||||
}
|
||||
|
||||
export const parseLinkData = (tnode:TNode):LinkData => {
|
||||
@ -90,11 +91,17 @@ export const parseLinkData = (tnode:TNode):LinkData => {
|
||||
|
||||
}
|
||||
|
||||
if(tnode.classes.includes('markdown-community-link')){
|
||||
return {
|
||||
type: 'markdown-community-link',
|
||||
community: tnode.attributes['data-community'],
|
||||
filter: tnode.attributes['data-filter'],
|
||||
}
|
||||
}
|
||||
|
||||
if (tnode.classes.includes('markdown-video-link-youtube')) {
|
||||
var embedUrl = tnode.attributes['data-embed-src'];
|
||||
|
||||
|
||||
|
||||
if (embedUrl) {
|
||||
return {
|
||||
type: 'markdown-video-link-youtube',
|
||||
|
@ -53,6 +53,7 @@ export const PostHtmlRenderer = memo(({
|
||||
tag,
|
||||
filter,
|
||||
videoHref,
|
||||
community
|
||||
} = data;
|
||||
|
||||
try {
|
||||
@ -98,6 +99,13 @@ export const PostHtmlRenderer = memo(({
|
||||
case 'markdown-proposal-link':
|
||||
setSelectedLink(href);
|
||||
break;
|
||||
|
||||
case 'markdown-community-link':
|
||||
//tag press also handles community by default
|
||||
if(handleTagPress){
|
||||
handleTagPress(community, filter)
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user