fnproject/tutorials

Double brackets {{ stuff }} in code blocks are not displayed after Jekyll Processing

Closed this issue · 3 comments

Code expressions that contain double brackets {{ stuff }} are being stripped from HTML output in the Flow 101 and Flow 102 tutorials.

Whenever a code block that contains double brackets is included in a Github Markdown file, the brackets and any included content is stripped from the output. For example:

FNSERVER_IP=$(docker inspect --type container -f '{{.NetworkSettings.IPAddress}}' fnserver)

When process to HTML will result in empty quotes: ''

Problem: The GitHub Jekyll processor uses the Liquid templating system to render HTML pages. The Liquid language uses double brackets as an expression substitution system. When, encountered, the expression in the brackets is processed. The result is returned to the HTML output and the brackets and their content is stripped from the output. This is note the desired behavior when displaying code samples. In addition, you cannot use HTML entities instead of brackets because the Markdown process does not convert HTML entities into the desired character output.

Workaround: Put any code sample containing double brackets in HTML tags. Then you can use HTML entities to represent the brackets. This prevents Liquid from stripping the expression from the output. Also, the bracket characters appear correctly in the output. For example:


FNSERVER_IP=$(docker inspect --type container -f '{{.NetworkSettings.IPAddress}}' fnserver)

Also seen in Flow 102

Will add 102 to my to do list.

After much research the solution is to use HTML for those examples and replace the special characters with character entities. The text then looks good and is readable on both Github and in the Jekyll output as well.

Fixed with PR: #136