-
Notifications
You must be signed in to change notification settings - Fork 135
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
Avoid removing break before and after heading #531
Avoid removing break before and after heading #531
Conversation
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.
Tests well
@mountiny Friendly bump! |
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.
Thanks everyone, sorry I have been at conference
@@ -235,7 +235,7 @@ export default class ExpensiMark { | |||
}, | |||
{ | |||
name: 'heading1', | |||
regex: /\s*<(h1)(?:"[^"]*"|'[^']*'|[^'">])*>(.*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))\s*/gi, | |||
regex: /[^\S\r\n]*<(h1)(?:"[^"]*"|'[^']*'|[^'">])*>(.*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))[^\S\r\n]*/gi, |
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 am curious to know why we are matching the newlines after the h1 tag. @eh2077 I don't see this clearly explained in proposal.
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.
any thoughts on how this has been working together with other pieces of the parser?
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.
@parasharrajat Sorry for late reply. The App prefers to let user input show as it is especially for line breaks. So we don't consume the line breaks here. I'm not sure if I answered your question. You can link the related issues, so I can have better context for what you ask.
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 didn't understand. Can you please summarize the problem and solution? I want to see how this logic fits into the whole picture. This way I can imagine the side-effect of changing something. #577 is the PR where we are changing this.
@@ -235,7 +235,7 @@ export default class ExpensiMark { | |||
}, | |||
{ | |||
name: 'heading1', | |||
regex: /\s*<(h1)(?:"[^"]*"|'[^']*'|[^'">])*>(.*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))\s*/gi, | |||
regex: /[^\S\r\n]*<(h1)(?:"[^"]*"|'[^']*'|[^'">])*>(.*?)<\/\1>(?![^<]*(<\/pre>|<\/code>))[^\S\r\n]*/gi, |
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.
This change caused Expensify/App#27445.
Fixed Issues
$ Expensify/App#17998
Tests
Screen.Recording.2023-05-09.at.7.20.49.PM.mov
QA
Same as test