2

In org-mode, if I do something like this:

#+begin_src org
## What does this PR do?
- Updates the Dockerfile to make the `dev` service connect to a shared network at startup
- Registers the `create_docker_network` and `remove_docker_network` `gogo` commands
- Advertises new `gogo` networking commands
- Bumps `gobase` version in the service's Jenkinsfile
- Provides a script to create the network at build time
- Adds a Jenkins step to run the script to create the network

## How to test
*Remember you have to download the latest `gogo` version!*

### To watch it fail
1. Run `gogo start`
* It will fail because most likely the network doesn't exist
#+end_src

The result gets rendered like this:

enter image description here

What can I do to make it render correctly as code?

3
  • THe first thing you should do is fix the syntax: #+begin_src and #+end_src (note the # - it is required).
    – NickD
    Dec 10, 2019 at 17:56
  • @NickD good catch! Typo is fixed now.
    – Mario Gil
    Dec 10, 2019 at 20:27
  • similar problem when using EXAMPLE blocks with org-mode inside
    – kai-dj
    Dec 10, 2019 at 21:04

2 Answers 2

1

The problem is that

* It will fail because most likely the network doesn't exist

is interpreted as Org mode heading. That also breaks the source block.

Just add a comma before those lines as in:

,* It will fail because most likely the network doesn't exist

The comma at the beginning of a line in a source block acts as an escape sequence escaping Org syntax.

Note that the line

*Remember you have to download the latest `gogo` version!*

does not match the syntax of an Org heading because of the missing space behind the leading star (sequence). Therefore, you do not need to escape that line.

0

As Tobias said, the "It will fail because most likely..." part is the conflicting part. I tried prepending a comma but that resulted in the literal comma exported in the code block so, instead of using that, I changed the * for a - which yield the same result in most Markdown implementations and avoided this issue.

I'll leave the question open in case someone finds a more satisfying solution to this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.