-
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
fix: keep tail spaces in heading #577
Conversation
Please take a look |
Looks like all tests passed. Great. @s-alves10 can you please analyze all tests related to the heading rule? Let me know if you find something strange. I will do that same but you can help me speed up the process. Thank you. |
These are expensify-common/__tests__/ExpensiMark-Markdown-test.js Lines 542 to 590 in cb1c6b7
Nothing strange is there. |
@s-alves10 I was checking the regex earlier and saw that the old regex does not match the newlines and spaces before the next line so in short the solution here is not justified. can you please explain how this regex change works? |
=>
=> The original regex works fine for the latter case but doesn't work for the first case(this is just our issue) because there is no I hope this makes sense |
I got it. Thanks for explaining. So it seems that the root cause is that we remove all the newlines from the output HTML. If the user types newlines on MD then they should be there. At least one should be there. The real issue is that we match the spaces in the next line after the heading tag. Given that regex was correct and it does not match the spaces on the next line, I don't think we should change it. The root issue is somewhere else which looks like it be
My question would be why do we remove one newline after the heading tag? |
I think removing one newline is reasonable because the newline in heading in markdown expresses the heading is ended. It doesn't mean newline. |
I see so you are saying that the heading is a block element and it itself should add newlines after being parsed into MD. Then wouldn't it make sense to remove BR and newline after the heading tag while converting to MD? Let me test this PR a bit to see there are no edge cases. |
I don't think so. |
I agree. I was saying the same. remove Br newlines while parsing HTML to MD and add just one. I guess this is what happening on main. But it also consumes spaces after the end tag which is the issue. |
What should I do next? This PR is 8 days old without any change. I'm not sure why |
My bad, I forgot to update here. I asked for the original change to clarify the regex because there was no mention of those changes on the issue or proposal. Seems like I didn't receive any response. #531 (comment). Meanwhile, I have tested a few possible patterns and all seem to work fine so I will approve it. Thanks for waiting. |
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.
LGTM.
🎀 👀 🎀 C+ reviewed
Please take a look |
What's the trouble with you? This PR was opened 2 weeks ago. Not sure what I can do here |
Couple things.
Last thing...
Just some feedback here - but that question commonly reads as having a critical tone. I am going to assume best intentions and believe that you didn't mean it that way. It would be better to ask: "How are things looking?" or "Can I please have a status update?", "Can I help unblock you in anyway?" etc. Those are all more polite ways to check in with a reviewer. |
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.
LGTM! Thanks for your patience.
I'm sorry if I was not polite. That's not my intention |
Fixed Issues
$ Expensify/App#27445
Tests
QA