Skip to content
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

Merged
merged 5 commits into from
Nov 27, 2018
Merged

Hk issue 776 #777

merged 5 commits into from
Nov 27, 2018

Conversation

hanneskaeufler
Copy link
Member

@hanneskaeufler hanneskaeufler commented Nov 27, 2018

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

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
Copy link
Member Author

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 `
Copy link
Member Author

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.

@orta
Copy link
Member

orta commented Nov 27, 2018

Yeah, cool - those make sense, thanks @hanneskaeufler - this feels good to me, I'll ship it once it's green

@orta orta merged commit 6dee41b into master Nov 27, 2018
@peril-staging
Copy link
Contributor

peril-staging bot commented Nov 27, 2018

Thanks for the PR @hanneskaeufler.

This PR has been shipped in v6.1.8 - CHANGELOG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants