Skip to content

Conversation

@MorganShorter
Copy link

Identify the Bug

Bad labels on fenced code blocks prevented syntax highlighting on much of the code examples. Some uncommon labels like bash break highlighting on non-github parsing libs. Incorrect labels like labeling .ini config files as shell break highlighting everywhere.

Description of the Change

Changed fenced code block labels.

Changed 3 long in-lined code blocks to fenced blocks. Altered accompanying quote blocks for clarity. This was just my own pedantic preference.

Changed json to JSON in one line because it's and acronym and my cursor was already there.

Alternate Designs

Alternates break parsers. It's a bug. Excluding the inline blocks and JSON, of course

Possible Drawbacks

Some of my changes are not conformant to R Markdown, but are consistent with the rest of the project. Specifically, the lack of extra linefeed characters (newline).

Verification Process

Parser stopped breaking. Checked the output visually for unintended side-effects

find ./ -name README.md -execdir pandoc -t html -f gfm -o '{}'.html --standalone '{}' \;

Release Notes

Most examples now have correct syntax highlighting and improved visual clarity. Non-jekyll gfm parsers should now be able to properly identify fenced code blocks by their labels.

@MorganShorter
Copy link
Author

This is tangentially related and just my opinion: The TerraForm examples use TF format, for which neither GitHub, nor pandoc, have a parser. This is not exactly a bug, but a good illustration of why one might prefer to use JSON over TF where feasible -- availability of external parsing libraries. This is a minor issue for READMEs, but not so minor for automatic code generation tools. My $0.02.

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.

1 participant