You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$125] Rules - "workspace rules" link shows html tags when copied from applied rule system message #82694
Version Number: 9.3.20-5 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#80853 Email or phone of affected tester (no customers):sdjoisjndoisnjodsoijo@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Rules are enabled.
Go to staging.new.expensify.com
Go to workspace settings > Rules.
Click Add merchant rule.
Create a rule which applies when Apple is merchant, Merchant will update to Banana.
Go to workspace chat.
Create an expense with Apple as merchant.
Open the expense report.
Right click on "set the merchant to..." system message > Copy to clipboard.
Paste the content.
Expected Result:
"workspace rules" link will not show html tags.
Actual Result:
"workspace rules" link shows html tags when copied from applied rule system message.
What changes do you think we should make in order to solve the problem?
We should use setClipboardMessage to copy the message to clipboard as it converts html to markdonw
setClipboardMessage(modifyExpenseMessage);
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Please re-state the problem that we are trying to solve in this issue.
When users copy the applied merchant-rule system message from a modified expense action, the pasted text includes raw HTML tags for the "workspace rules" link instead of clean readable text.
What is the root cause of that problem?
The modified-expense copy branch writes the message to clipboard with Clipboard.setString() directly, even though the message can contain HTML.
That message can include an anchor tag by design (via <a href="...">workspace rules</a>), so copying it as plain string preserves HTML markup. This causes pasted content to show raw <a ...> tags because no HTML-to-markdown conversion is applied in this branch.
returnisFirst ? `set the ${field} to "${value}"` : `${field} to "${value}"`;
},
format: (fragments: string,route: string)=>`${fragments} via <a href="${route}">workspace rules</a>`,
},
common: (key: keyofPolicyRulesModifiedFields,value: string,isFirst: boolean)=>{constfield=translations.common[key].toLowerCase();returnisFirst ? `set the ${field} to "${value}"` : `${field} to "${value}"`;},format: (fragments: string,route: string)=>`${fragments} via <a href="${route}">workspace rules</a>`,
What changes do you think we should make in order to solve the problem?
Use setClipboardMessage(modifyExpenseMessage) in the modified-expense branch so HTML messages are converted to markdown/plain text consistently with the rest of the context menu copy handlers.
This keeps behavior aligned with other HTML-capable report actions already using setClipboardMessage(), and ensures plain-text paste does not expose raw HTML tags.
What alternative solutions did you explore? (Optional)
Add a local HTML check (displayMessage === Parser.htmlToText(displayMessage)) before deciding clipboard method in this branch.
Rejected because setClipboardMessage() already centralizes the conversion logic and keeps copy handling consistent with similar branches.
changed the title [-]Rules - "workspace rules" link shows html tags when copied from applied rule system message[/-][+][$250] Rules - "workspace rules" link shows html tags when copied from applied rule system message[/+]on Mar 17, 2026
changed the title [-][$250] Rules - "workspace rules" link shows html tags when copied from applied rule system message[/-][+][$125] Rules - "workspace rules" link shows html tags when copied from applied rule system message[/+]on Mar 17, 2026
Please re-state the problem that we are trying to solve in this issue.
When a workspace merchant rule is applied to an expense (e.g., "set the merchant to Banana"), right-clicking the system message and selecting "Copy to clipboard" copies the raw HTML <a> tags for the "workspace rules" link, causing the pasted text to show something like via <a href="...">workspace rules</a> instead of clean, readable text.
This ensures the "workspace rules" link is converted to a clean markdown link [workspace rules](url) for the plain text clipboard, matching the behavior of other HTML-containing messages.
⚠️@mukhrr Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
Activity
etCoderDysto commentedon Feb 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
"workspace rules" link shows html tags when copied from applied rule system message
What is the root cause of that problem?
iou.policyRulesModifiedFields.formatkey wraps the link in anchor tagApp/src/libs/ModifiedExpenseMessage.ts
Line 240 in 4d0f402
But when we copy the html we are using
Clipboard.setString. AndClipboard.setString, doesn't convert html content to markdown.App/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Lines 779 to 789 in e01e89a
What changes do you think we should make in order to solve the problem?
We should use
setClipboardMessageto copy the message to clipboard as it converts html to markdonwWhat alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
annaweber830 commentedon Feb 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When users copy the applied merchant-rule system message from a modified expense action, the pasted text includes raw HTML tags for the "workspace rules" link instead of clean readable text.
What is the root cause of that problem?
The modified-expense copy branch writes the message to clipboard with
Clipboard.setString()directly, even though the message can contain HTML.App/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Lines 779 to 789 in d3c00a5
That message can include an anchor tag by design (
via <a href="...">workspace rules</a>), so copying it as plain string preserves HTML markup. This causes pasted content to show raw<a ...>tags because no HTML-to-markdown conversion is applied in this branch.App/src/languages/en.ts
Lines 1553 to 1558 in d3c00a5
What changes do you think we should make in order to solve the problem?
Use
setClipboardMessage(modifyExpenseMessage)in the modified-expense branch so HTML messages are converted to markdown/plain text consistently with the rest of the context menu copy handlers.App/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Lines 779 to 789 in d3c00a5
Current code:
Updated code:
This keeps behavior aligned with other HTML-capable report actions already using
setClipboardMessage(), and ensures plain-text paste does not expose raw HTML tags.What alternative solutions did you explore? (Optional)
displayMessage === Parser.htmlToText(displayMessage)) before deciding clipboard method in this branch.setClipboardMessage()already centralizes the conversion logic and keeps copy handling consistent with similar branches.melvin-bot commentedon Feb 23, 2026
Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Mar 5, 2026
This issue has not been updated in over 14 days. eroding to Weekly issue.
1 remaining item
melvin-bot commentedon Mar 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)[-]Rules - "workspace rules" link shows html tags when copied from applied rule system message[/-][+][$250] Rules - "workspace rules" link shows html tags when copied from applied rule system message[/+]melvin-bot commentedon Mar 17, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022033944059526830680
[-][$250] Rules - "workspace rules" link shows html tags when copied from applied rule system message[/-][+][$125] Rules - "workspace rules" link shows html tags when copied from applied rule system message[/+]melvin-bot commentedon Mar 17, 2026
Upwork job price has been updated to $125
mukhrr commentedon Mar 17, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a workspace merchant rule is applied to an expense (e.g., "set the merchant to Banana"), right-clicking the system message and selecting "Copy to clipboard" copies the raw HTML
<a>tags for the "workspace rules" link, causing the pasted text to show something likevia <a href="...">workspace rules</a>instead of clean, readable text.What is the root cause of that problem?
When copying a modified expense message that was triggered by policy rules, the code uses
Clipboard.setString()directly with the message returned bygetForReportActionTemp(). This message contains HTML anchor tags (e.g.,<a href="...">workspace rules</a>) because it is intended to be rendered as HTML in the chat. However,Clipboard.setString()copies the string as-is without stripping or converting the HTML, so the raw tags end up in the clipboard.https://github.com/Expensify/App/blob/eb0e71a21cb7c337ead8c37cd47140cae68fd8ca/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L779-L789
Other report action types that contain HTML (e.g., task actions at line 778, member change actions at line 806) correctly use the
setClipboardMessage()helper, which converts HTML to markdown for the plain text clipboard and preserves HTML for rich text. The modified expense action branch is the only one that bypasses this.https://github.com/Expensify/App/blob/eb0e71a21cb7c337ead8c37cd47140cae68fd8ca/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L211-L223
What changes do you think we should make in order to solve the problem?
ContextMenuActions.tsx, change the modified expense action copy handler to usesetClipboardMessage()if it's html markdown, so the HTML content is properly converted to markdown for the plain text clipboard.https://github.com/Expensify/App/blob/eb0e71a21cb7c337ead8c37cd47140cae68fd8ca/src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx#L789
This ensures the "workspace rules" link is converted to a clean markdown link
[workspace rules](url)for the plain text clipboard, matching the behavior of other HTML-containing messages.github-actions commentedon Mar 17, 2026
eVoloshchak commentedon Mar 18, 2026
@etCoderDysto's proposal looks good to me!
🎀👀🎀 C+ reviewed!
melvin-bot commentedon Mar 18, 2026
Current assignee @luacmartins is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
situchan commentedon Mar 18, 2026
This is no longer reproducible
luacmartins commentedon Mar 18, 2026
Cool, seems like we can close this then