Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ function AnchorRenderer(props) {
const isAttachment = Boolean(htmlAttribs['data-expensify-source']);
const fileName = lodashGet(props.tnode, 'domNode.children[0].data', '');
const parentStyle = lodashGet(props.tnode, 'parent.styles.nativeTextRet', {});
const internalExpensifyPath = (htmlAttribs.href.startsWith(CONST.NEW_EXPENSIFY_URL) && htmlAttribs.href.replace(CONST.NEW_EXPENSIFY_URL, ''))
|| (htmlAttribs.href.startsWith(CONST.STAGING_NEW_EXPENSIFY_URL) && htmlAttribs.href.replace(CONST.STAGING_NEW_EXPENSIFY_URL, ''));
const attrHref = htmlAttribs.href || '';
const internalExpensifyPath = (attrHref.startsWith(CONST.NEW_EXPENSIFY_URL) && attrHref.replace(CONST.NEW_EXPENSIFY_URL, ''))
|| (attrHref.startsWith(CONST.STAGING_NEW_EXPENSIFY_URL) && attrHref.replace(CONST.STAGING_NEW_EXPENSIFY_URL, ''));

// If we are handling a New Expensify link then we will assume this should be opened by the app internally. This ensures that the links are opened internally via react-navigation
// instead of in a new tab or with a page refresh (which is the default behavior of an anchor tag)
Expand All @@ -114,7 +115,7 @@ function AnchorRenderer(props) {
<Text
style={styles.link}
onPress={() => {
Linking.openURL(htmlAttribs.href);
Linking.openURL(attrHref);
}}
>
<TNodeChildrenRenderer tnode={props.tnode} />
Expand All @@ -124,7 +125,7 @@ function AnchorRenderer(props) {

return (
<AnchorForCommentsOnly
href={htmlAttribs.href}
href={attrHref}
isAuthTokenRequired={isAttachment}

// Unless otherwise specified open all links in
Expand Down