Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(PDOC-233) markdown whitespace fixes #170

Merged
merged 3 commits into from
Apr 3, 2018

Conversation

JohnLyman
Copy link
Contributor

  • Adds blank line padding around header elements so they will render correctly with other markdown variants
  • Minor updates to make whitespace consistent

I wasn't sure how to add tests for this to prevent future updates from breaking rendering. Someone would need to know to add blank lines around headers in the output fixtures if/when they are updated. I thought of adding a test that would read the fixture file and check the linespace padding, but if a new fixture is added (like one was recently), someone would also need to know to add a test against the new fixture. Testing the test fixture itself is not typical and didn't feel right.

Some variants of markdown do not convert atx-style headers correctly
unless they are surrounded by blank lines.  This commit adds blank lines
to increase chances of rendering when using those variants while still
maintaining compatibly with variants that do not require the surrounding
blank lines.  Also increases readability when viewing the raw markdown
file.
Replace arbitrary double blank lines with a single blank lines.
Instead of specifying white space after each conditional, just add a
blank line at the end of the conditional similar to the `function.erb`
template.
@eputnam
Copy link
Contributor

eputnam commented Apr 3, 2018

this is awesome @JohnLyman ! Thanks!

It's actually fairly common practice at Puppet to have spacing around headers, I was just being lazy in this case because I didn't think it was a big deal. I was wrong! Anyway, I'll at least try to look out for it until we come up with a way to maybe keep an eye on it.

@eputnam eputnam merged commit a4e9150 into puppetlabs:master Apr 3, 2018
@eputnam eputnam added the bugfix label Apr 4, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants