-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Hk issue 776 #777
Hk issue 776 #777
Conversation
For github to render markdown in tables there has to be some space around the message. This will add a <p> and render the markdown. However, it also leads to some funky vertical spacing due to the nature of some browser styling for the <p> tag. This commit looks at the message to determine if it contains markdown, if yes, then add the space for proper rendering. If not, render the compacter table to get nice vertical alignment.
} | ||
|
||
function containsMarkdown(message: string): boolean { | ||
return message.match(/[`*_~\[]+/g) ? true : false |
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.
That's pretty naive 🤷🏼♂️
: violation.message | ||
|
||
if (containsMarkdown(message)) { | ||
message = `\n\n ${message}\n ` |
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 kinda keeps some weird indentation to keep the snapshots happy. Was easier to avoid breaking anything this way.
Yeah, cool - those make sense, thanks @hanneskaeufler - this feels good to me, I'll ship it once it's green |
Thanks for the PR @hanneskaeufler. This PR has been shipped in v6.1.8 - CHANGELOG. |
For github to render markdown in tables there has to be some space
around the message. This will add a
<p>
and render the markdown.However, it also leads to some funky vertical spacing due to the nature
of some browser styling for the
<p>
tag.This PR looks at the message to determine if it contains markdown,
if yes, then add the space for proper rendering. If not, render the
compacter table to get nice vertical alignment.
Closes #776