-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-04-17] [Due for payment 2025-04-10] [$250] Markdown - Nested markdown not displayed in conversation #58468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Triggered auto assignment to @OfstadC ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Nested markdown is not displayed in conversation. What is the root cause of that problem?In both EMRenderer.ts and StrongRenderer.ts we use To make text italic we apply When we have nested tags like this <strong>
<em>text</em>
</strong> the following properties are applied
You can see that the What changes do you think we should make in order to solve the problem?One solution would be to apply Instead we can manually apply the correct font family depending on whether function isChildOfStrong(tnode: TNode): boolean {
return isChildOfNode(tnode, (node) => node.domNode?.name !== undefined && node.domNode.name.toLowerCase() === 'strong');
}
function isChildOfEm(tnode: TNode): boolean {
return isChildOfNode(tnode, (node) => node.domNode?.name !== undefined && node.domNode.name.toLowerCase() === 'em');
} Then modify StrongRenderer.ts so that it uses bold+italic font when the Code function StrongRenderer({tnode}: CustomRendererProps<TText | TPhrasing>) {
const styles = useThemeStyles();
const isChildOfTaskTitle = HTMLEngineUtils.isChildOfTaskTitle(tnode);
+ const isChildOfEm = HTMLEngineUtils.isChildOfEm(tnode);
+
+ const fontFamily = isChildOfEm
+ ? FontUtils.fontFamily.platform.EXP_NEUE_BOLD_ITALIC
+ : FontUtils.fontFamily.platform.EXP_NEUE_BOLD;
return 'data' in tnode ? (
- <Text style={[styles.webViewStyles.baseFontStyle, styles.strong, isChildOfTaskTitle && styles.taskTitleMenuItem]}>{tnode.data}</Text>
+ <Text style={[styles.webViewStyles.baseFontStyle, fontFamily, isChildOfTaskTitle && styles.taskTitleMenuItem]}>{tnode.data} </Text>
) : (
<TNodeChildrenRenderer
tnode={tnode}
renderChild={(props) => {
return (
<Text
- style={[styles.webViewStyles.baseFontStyle, styles.strong, isChildOfTaskTitle && styles.taskTitleMenuItem]}
+ style={[styles.webViewStyles.baseFontStyle, fontFamily, isChildOfTaskTitle && styles.taskTitleMenuItem]}
key={props.key}
>
Similarly update EMRenderer.ts. However, instead of using Code function EMRenderer({tnode}: CustomRendererProps<TText | TPhrasing>) {
const styles = useThemeStyles();
const isChildOfTaskTitle = HTMLEngineUtils.isChildOfTaskTitle(tnode);
+ const isChildOfStrong = HTMLEngineUtils.isChildOfStrong(tnode);
+
+ const fontFamily = isChildOfStrong
+ ? FontUtils.fontFamily.platform.EXP_NEUE_BOLD_ITALIC
+ : FontUtils.fontFamily.platform.EXP_NEUE_ITALIC;
return 'data' in tnode ? (
- <Text style={[styles.webViewStyles.baseFontStyle, styles.webViewStyles.tagStyles.em, isChildOfTaskTitle && styles.taskTitleMenuItemItalic]}>{tnode.data}</Text>
+ <Text style={[styles.webViewStyles.baseFontStyle, fontFamily, isChildOfTaskTitle && styles.taskTitleMenuItemItalic]}>{tnode.data}</Text>
) : (
<TNodeChildrenRenderer
tnode={tnode}
renderChild={(props) => {
return (
<Text
- style={[styles.webViewStyles.baseFontStyle, styles.strong, isChildOfTaskTitle && styles.taskTitleMenuItem]}
+ style={[styles.webViewStyles.baseFontStyle, fontFamily, isChildOfTaskTitle && styles.taskTitleMenuItemItalic]}
key={props.key}
> Result: What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?Render markdown such as |
ProposalPlease re-state the problem that we are trying to solve in this issue.Nested markdown doesn't have correct style. What is the root cause of that problem?We now have a custom rendered for bold, italic, etc. If we look at the bold renderer, for example, we kinda "hardcoded" the style to only be a bold text, without considering a nested markdown style.
What changes do you think we should make in order to solve the problem?We need to replace
We need to apply this to bold, italic, etc renderer where nested markdown is allowed. What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A |
Job added to Upwork: https://www.upwork.com/jobs/~021901686536886743365 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil ( |
@rojiphil Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Thanks for the proposals. |
Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Hey, so while working on the PR, I noticed that when applying the
I think this whole custom renderer for the task title is a bit of a mess. If we see the StrongRenderer above and compare it to the EMRendere below, App/src/components/HTMLEngineProvider/HTMLRenderers/EMRenderer.tsx Lines 12 to 26 in 8deddfa
we can notice that the style of the So, I'm thinking of a better and cleaner solution for the task title HTML renderer and will also solve this issue. For context, the reason we add a custom renderer for italic, strong, etc. is that we want to apply By default, EM has a EXP_NEUE_ITALIC font family, and inside a task title, we want it to be EXP_NEW_KANSAS_MEDIUM_ITALIC, so a custom renderer is created to override the style. Lines 152 to 156 in 8deddfa
My new proposal is: Lines 153 to 157 in 8deddfa
So, how will we handle the styling? We will use App/src/components/HTMLEngineProvider/BaseHTMLEngineProvider.tsx Lines 80 to 84 in 8deddfa
For example, for italic/em, we will do it like this:
No need for custom renderer. @rojiphil @srikarparsi Let me know what you think! |
The above new solution will also fix #58883 |
@rojiphil Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@bernhardoj Yeah. Removing the custom renderer and adding styling using |
Opened a new PR cc: @rojiphil The issue is caused because I set the h1 element to textual instead of block. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.25-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-04-17. 🎊 For reference, here are some details about the assignees on this issue:
|
@rojiphil @OfstadC @rojiphil The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
@rojiphil please complete BZ checklist prior to 2025-04-17 so we can issue payment 😃 Thanks! |
Payment Summary
BugZero Checklist (@OfstadC)
|
@rojiphil Please complete BZ Checklist so payment can be issued here 😄 - Thank you! |
Bump @rojiphil |
@OfstadC Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Sorry for the delay here. Will complete the checklist in an hour or so. |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalPrecondition:Test:
Do we agree 👍 or 👎 |
Payment Summary is accurate 😃 |
Requested in ND. |
$250 approved for @rojiphil |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v9.1.13-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5740356
Issue reported by: Applause Internal Team
Device used: Windows 11/ Chrome, Android 13/ chrome
App Component: Other
Action Performed:
Expected Result:
All markdown applied are shown in conversation.
Actual Result:
Only a single markdown of nested markdown is displayed in a conversation.
Workaround:
Unknown
Platforms:
Screenshots/Videos
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v9.1.13-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Windows 11/ Chrome, Android 13/ chrome
App Component: Other
Action Performed:
_*bold*_ or *_bold_*
)Expected Result:
All markdown applied are shown in conversation.
Actual Result:
Only a single markdown of nested markdown is displayed in a conversation.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6770480_1741944295410.bandicam_2025-03-14_12-10-17-815.1.mp4
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @OfstadCThe text was updated successfully, but these errors were encountered: