-
Notifications
You must be signed in to change notification settings - Fork 78
Implement code and pre blocks support on web #456
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
base: main
Are you sure you want to change the base?
Implement code and pre blocks support on web #456
Conversation
Fixed! @Skalakid |
Found couple of new bugs: bug.1.movbug.2.mov |
Found two smaller issues:
Screen.Recording.2024-12-12.at.12.40.34.mov
Screen.Recording.2024-12-12.at.12.45.15.mov |
3b823bc
to
4aa355b
Compare
src/web/utils/webStyleUtils.ts
Outdated
'min-width': `min(calc(100% + 2.5px), ${preBlockWidth + horizontalPadding * 2 + 1}px)`, | ||
'max-width': `min(${preBlockWidth + horizontalPadding * 2 + 2}px, ${contentWidth}px)`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could potentially remove these lines, set before's content: ""
and width: 100%
.
I've tried making it work and it seems promising it's just that you'd need to force a linebreak whenever user tries to write something directly after closing backticks and that's something I didn't manage to implement cleanily @Skalakid
6047954
to
1f2e93f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some small comments
src/web/utils/webStyleUtils.ts
Outdated
|
||
const lineHeight = line.getBoundingClientRect()?.height; | ||
const preStyles = markdownStyle.pre; | ||
const padding = preStyles?.padding ?? 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2
? Shouldn't we use the default style value from makeDefaultMarkdownStyle
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure this is to account for border adding 1px
on each side, but you can try to change this to see 👀
@tomekzaw bump :D |
Details
Related Issues
GH_LINK
Manual Tests
Change codeFance rule in
/node_modules/expensify-common/dist/ExpensiMark.js
to code belowLinked PRs