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

x/tools/cmd/present2md: code blocks only output one level of indentation #39731

Open
autarch opened this issue Jun 20, 2020 · 0 comments
Open
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@autarch
Copy link

autarch commented Jun 20, 2020

What version of Go are you using (go version)?

$ go version
go version go1.14.2 linux/amd64

Does this issue reproduce with the latest release?

This isn't an issue with the go core.

I did install the latest version of present with go get -u golang.org/x/tools/cmd/present2md

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/autarch/.cache/go-build"
GOENV="/home/autarch/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY="github.com/ActiveState"
GONOSUMDB="github.com/ActiveState"
GOOS="linux"
GOPATH="/home/autarch/go"
GOPRIVATE="github.com/ActiveState"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build349158934=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I ran the tool to convert some slides.

What did you expect to see?

For code blocks that are part of a list, Markdown requires that there be extra indentation. So for example with a top-level list, you need two levels of indentation for a code block (8 spaces or 2 tabs). For a second level list you need three levels of indentation, etc.

Alternatively, CommonMark supports fenced code blocks, which work without any indentation in all contexts.

What did you see instead?

All code blocks are output with just one level of indentation, meaning any code block in a list was no longer formatted correctly.

Rather than trying to get the indentation right, I'd suggest just outputting a fenced code block. This is a lot simpler to edit later since you never have to fiddle with the indentation.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jun 20, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jun 20, 2020
@smasher164 smasher164 changed the title x/tools/cmd/present2md x/tools/cmd/present2md: code blocks only output one level of indentation Jun 21, 2020
@smasher164 smasher164 added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants