Skip to content

Commit

Permalink
Merge pull request #5060 from pROFESOR11/fix-4897-override-a-styles-w…
Browse files Browse the repository at this point in the history
…ith-parent

override default anchor style with parent style
  • Loading branch information
marcaaron authored Sep 14, 2021
2 parents 651c948 + c91cb2e commit a6bc4f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function AnchorRenderer({tnode, key, style}) {
// An auth token is needed to download Expensify chat attachments
const isAttachment = Boolean(htmlAttribs['data-expensify-source']);
const fileName = lodashGet(tnode, 'domNode.children[0].data', '');
const parentStyle = lodashGet(tnode, 'parent.styles.nativeTextRet', {});
const internalExpensifyPath = htmlAttribs.href.startsWith(CONST.NEW_EXPENSIFY_URL) && htmlAttribs.href.replace(CONST.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
Expand Down Expand Up @@ -99,7 +100,7 @@ function AnchorRenderer({tnode, key, style}) {
// eslint-disable-next-line react/jsx-props-no-multi-spaces
target={htmlAttribs.target || '_blank'}
rel={htmlAttribs.rel || 'noopener noreferrer'}
style={style}
style={{...style, ...parentStyle}}
key={key}
fileName={fileName}
>
Expand Down

0 comments on commit a6bc4f6

Please sign in to comment.