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

Add --no-escape flag for Markdown printer #117

Merged
merged 1 commit into from
Jul 17, 2019

Conversation

khos2ow
Copy link
Member

@khos2ow khos2ow commented Jul 5, 2019

Prerequisites

Put an x into the box(es) that apply:

  • This pull request fixes a bug.
  • This pull request adds a feature.
  • This pull request enhances existing functionality.
  • This pull request introduces breaking change.

For more information, see the Contributing Guide.

Description

This PR adds a new flag --no-escape to markdown (also its alias: md) commands to not escaping special characters. The issue has been discussed at length at #111 .

Note that the default behavior is that Markdown printer escapes the characters and you need to explicitly tell terraform-doc to not escape them.

Issues Resolved

Fixes #111

Checklist

Put an x into all boxes that apply:

Tests

  • I have added tests to cover my changes.
  • All tests pass when I run make test.

Documentation

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Code Style

  • My code follows the code style of this project.

@khos2ow
Copy link
Member Author

khos2ow commented Jul 5, 2019

@metmajer Since "escaping" is now a new concept, I've changed the test golden files to be in normal non-escaped state and added a new file with escaped characters.

@metmajer
Copy link
Member

metmajer commented Jul 9, 2019

@khos2ow thanks for the PR, I'll provide some feedback over the next days!

@metmajer
Copy link
Member

@khos2ow if escaping is the default (escaping has to be disabled explicitly using --no-escape-flag), why are the existing golden files not in the escaped state then? These should reflect the default case. From your explanations, however, I understand that this is not the case?

@khos2ow
Copy link
Member Author

khos2ow commented Jul 17, 2019

@metmajer sorry for the delay. It indeed is disabled by default (set here).

All the existing golden files and corresponding test cases follow the same approach and I didn't want to change the logic in only one test. I mean flags --no-required and --no-sort are disabled by default but we explicitly enable them only in their corresponding test cases (TestPrintWithRequired and TestPrintWithSortByName) and this is the same case for --no-escape and TestPrintWithEscapeName.

@metmajer
Copy link
Member

@khos2ow likewise, and thanks. I should have taken the time to double-check on our default behavior. Current projects are keeping me busy like crazy. Cheers!

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.

restore and remove the annoying bask slashs
2 participants