Skip to content

Commit 5e15a63

Browse files
committed
Normalize iouComment to markdown before rendering
The description field of a saved transaction is stored as HTML (e.g. <a href="https://google.com">google.com</a>), but MoneyRequestConfirmationListFooter feeds it into a MenuItemWithTopDescription with shouldParseTitle, which runs ExpensiMark markdown-to-HTML on the value. When the input is already HTML, ExpensiMark HTML-escapes the <a> tags, so the user sees raw <a href=...>google.com</a> text on the Split details page. Prior to the 'remove redundant props' refactor, SplitBillDetailsPage normalized the stored HTML with Parser.htmlToMarkdown() before passing iouComment down. That normalization was dropped when iouComment moved to a single internal derivation in MoneyRequestConfirmationList. Restoring the htmlToMarkdown call at the producer keeps every downstream consumer (shouldParseTitle menu item and type='markdown' text input) consistent for both draft (plain text) and saved (HTML) transactions, and avoids regressing auto-linking of bare URLs in draft confirmation flows.
1 parent 69a3bdc commit 5e15a63

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/MoneyRequestConfirmationList.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import Log from '@libs/Log';
2626
import {validateAmount} from '@libs/MoneyRequestUtils';
2727
import Navigation from '@libs/Navigation/Navigation';
2828
import {getIOUConfirmationOptionsFromPayeePersonalDetail, hasEnabledOptions} from '@libs/OptionsListUtils';
29+
import Parser from '@libs/Parser';
2930
import {getTagLists, isAttendeeTrackingEnabled, isTaxTrackingEnabled} from '@libs/PolicyUtils';
3031
import {isSelectedManagerMcTest} from '@libs/ReportUtils';
3132
import type {OptionData} from '@libs/ReportUtils';
@@ -291,7 +292,11 @@ function MoneyRequestConfirmationList({
291292
const isGPSDistanceRequest = isGPSDistanceRequestUtil(transaction);
292293

293294
const iouAmount = hasValidModifiedAmount(transaction) ? Number(transaction?.modifiedAmount) : (transaction?.amount ?? 0);
294-
const iouComment = getDescription(transaction);
295+
// `getDescription` returns the raw `transaction.comment.comment`, which is stored as HTML for saved
296+
// transactions (e.g. viewing a completed split on `SplitBillDetailsPage`). Normalize to markdown here
297+
// so every downstream consumer (`shouldParseTitle` menu item and `type="markdown"` input) receives
298+
// a consistent format regardless of whether the transaction is a draft (plain text) or a saved one (HTML).
299+
const iouComment = Parser.htmlToMarkdown(getDescription(transaction));
295300
const iouCurrencyCode = getCurrency(transaction);
296301
const iouMerchant = getMerchant(transaction);
297302
const iouCreated = getCreated(transaction);

0 commit comments

Comments
 (0)