mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-17 02:13:34 +03:00
hanled a tag for img source
This commit is contained in:
parent
1a4f6fe8ce
commit
e489f72af4
@ -50,9 +50,7 @@ class PostCardContainer extends PureComponent {
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.POST,
|
||||
params: {
|
||||
// content,
|
||||
permlink: content.permlink,
|
||||
author: content.author,
|
||||
content,
|
||||
},
|
||||
key: content.permlink,
|
||||
});
|
||||
|
@ -40,10 +40,6 @@ export const markDown2Html = (input) => {
|
||||
output = createYoutubeIframe(output);
|
||||
}
|
||||
|
||||
if (aTagRegex.test(output)) {
|
||||
output = handleATag(output);
|
||||
}
|
||||
|
||||
if (imgTagRegex.test(output)) {
|
||||
output = handleImageTag(output);
|
||||
}
|
||||
@ -76,6 +72,10 @@ export const markDown2Html = (input) => {
|
||||
output = handleLinks(output);
|
||||
}
|
||||
|
||||
if (aTagRegex.test(output)) {
|
||||
output = handleATag(output);
|
||||
}
|
||||
|
||||
output = md.render(output);
|
||||
|
||||
return output;
|
||||
@ -112,6 +112,12 @@ const handleATag = input => input.replace(aTagRegex, (link) => {
|
||||
return link;
|
||||
}
|
||||
|
||||
if (imgRegex.test(link)) {
|
||||
const imgMatch = link.match(imgRegex)[0];
|
||||
|
||||
if (imgMatch) return `<a src="${imgMatch}">Image</a>`;
|
||||
}
|
||||
|
||||
return link;
|
||||
});
|
||||
|
||||
@ -208,7 +214,6 @@ const handleIframe = input => input.replace(iframeRegex, (link) => {
|
||||
const match = link.match(linkRegex);
|
||||
|
||||
if (match && match[0]) {
|
||||
|
||||
return iframeBody(match[0]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user