This is a follow up to #38 where @karelbilek brought up that
we shouldn't reformat source code blocks by default at all.
With this change, fenced code blocks tagged with Go or go
will no longer be formatted with gofmt by default.
Users are expected to opt-into this functionality.
When using markdownfmt as a library,
users can opt-in by adding the following option.
WithCodeFormatters(GoCodeFormatter)
When using markdownfmt as a binary,
users can opt-in by adding the following flag:
-gofmt
For integration tests,
I changed example1.input/output to have incorrectly formatted Go code,
and added separate gofmt-input/output files to test behavior
with the GoCodeFormatter enabled.
This is a follow up to #38 where @karelbilek brought up that we shouldn't reformat source code blocks by default at all.
With this change, fenced code blocks tagged with
Go
orgo
will no longer be formatted withgofmt
by default. Users are expected to opt-into this functionality.When using markdownfmt as a library, users can opt-in by adding the following option.
When using markdownfmt as a binary, users can opt-in by adding the following flag:
For integration tests, I changed example1.input/output to have incorrectly formatted Go code, and added separate gofmt-input/output files to test behavior with the GoCodeFormatter enabled.
Resolves #46