-
Notifications
You must be signed in to change notification settings - Fork 136
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
update inlineCodeBlock replace regex #607
update inlineCodeBlock replace regex #607
Conversation
It will be great if it is tested by linking this lib with App repo |
@MonilBhavsar I tested it and attached the record video. |
In the future, please link the issue with these steps so that it assigns the correct people to review
|
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.
I tested it and attached the record video.
Sorry, could not find it
@MonilBhavsar I attached the video and resolved problems. Please review again. Screencast.from.2023.11.21.22.13.30.webm |
Hmm, I see you just removed those cases. Perhaps we might want to make it work as expected by updating our regex |
@MonilBhavsar You can see that issue on staging server right now and so it's not because of regex update of this PR. I did simple investigation and it is because of space character before backtick. bandicam.2023-11-22.09-39-54-719.mp4 |
I think you're right. Slack does not consider a code block if it is proceeded by a character. It works in github though. I think the tests you added here were correct but our markdown didn't parse them as expected. Looks like currently in expensify app, when we enter " Seems like we're breaking lots of cases for supporting an edge case. |
@MonilBhavsar Could you please tell me more details? I couldn't understand what you mean.
Could you please let me know what is wrong? |
@MonilBhavsar, should we create a pull request in NewDot, using a commit hash that points to these changes? This will allow us to test this issue directly within the app and complete the checklist if needed. |
92337a1
to
939ccb9
Compare
@MonilBhavsar Can we merge this PR if there isn't other problem? So we can proceed to next stage. |
We can do it locally, right? |
Yes, that's right and it is how it should be expected. But, if you paste those strings in slack, it is not rendered as expected. I mean to say for the string in the issue - " |
@MonilBhavsar In this issue, I suggested to update regex to fix this error and it showed same result with Slack.
I think we should refer to both of them to get the best UX. Instead of trying to match with one of them. |
@MonilBhavsar Do we have any assumptions for the code block when it was designed so that we can refer to it? |
After further research and testing, I have not found a more suitable regex than the one @akamefi202 provided |
Yes, I agree. But for this specific issue or code block, we referred to slack's way of parsing markdown and that is very different, I think. |
I don't think so. cc @thienlnam if you have any idea, since I believe you are working with live markdown feature so you might know |
👍 @akamefi202 can we please re add those automated tests that you removed, and perhaps some more? |
@MonilBhavsar I added them and please review it. |
I don't think so. cc @thienlnam if you have any idea, since I believe you are working with live markdown feature so you might know Ideally it's just a subset of actual markdown. Though when we were building it out we started with the most straightforward implementation. I'm just guessing this is a bug we didn't intentionally add |
👍 Right. This is a bug, but the markdown is bit complicated, so not sure how we would parse. So just wanted to get the views. Looks like we're all good here. |
@akamefi202 this commit is unsigned b896579 |
You can follow these steps to sign that commit
|
5b9f396
to
d6895b5
Compare
Signed-off-by: akamefi202 <akamefi202@gmail.com>
Signed-off-by: akamefi202 <akamefi202@gmail.com>
Signed-off-by: akamefi202 <akamefi202@gmail.com>
Signed-off-by: akamefi202 <akamefi202@gmail.com>
Signed-off-by: akamefi202 <akamefi202@gmail.com>
d6895b5
to
4e2404c
Compare
@MonilBhavsar I signed commits again and please approve & merge the PR. |
Thanks! |
This PR updated
inlineCodeBlock
replace regex to preventing existence of code fence(<pre>
tag) inside inline code(<code>
tag).So if
<pre>
tag already exists inside backticks(`
), it blocks replacement ofinlineCodeBlock
.Before update:
After update:
Fixed Issues
$ GH_LINK
Tests
I added "Test code fence within inline code" test case for this.
I ran "npm run test" and confirmed all tests passed successfully.
QA
Open any chat.
Write "
(```test```)
" in the composer and send the message.The message is shown immediately in expected format.
Run "npm run test".