0

I am uncertain how to handle the following mixed code/list constructs:

Note: pretend the 2 backticks below were actually 3 for a proper fenced code block ..)

``java
 startHttpServer();
 System.out.println(
 "Http Server Listening on " + SConstants.HTTP_PORT + SConstants.HTTP_PROJECT_NAME);
``
 @ Logging level can be calibrated by simple change(s) to logging.xml and/or log4j.properties
 - _Comments_: this seems to be mostly in place
 @ Errors and exceptions go to appropriate WARN and/or ERROR logging levels

Here is the result: notice all of the content after the code fence starting with are distorted by incorrect font, indentation, and loss of numbering:

enter image description here

This same issue shows for any Constructs that require left-most margin:

  • code fences
  • images and links

How should this document section be restructured to retain ability to include the code fences, url's and images yet without disturbing the numbering, font, and indentation?

btw I'm running the markdown through pandoc : not sure if the latter were involved in causing the issue or if this were native markdown issue.

Update Here is final version that does work: with an assist from the accepted answer of @eskwaryd

1. Code Behaviors
 1. Logging
 @. No "bare" `System.out.println` 's
 _Comments_: _Many_ of these exist. Here is a partial list
 Here is one code example
 ``java
 startHttpServer();
 System.out.println(
 "Http Server Listening on " + SparcleConstants.HTTP_PORT + SparcleConstants.HTTP_PROJECT_NAME);
 ``
 @. Logging level can be calibrated by simple change(s) to logging.xml and/or log4j.properties
 - _Comments_: this seems to be mostly in place
 @. Errors and exceptions go to appropriate WARN and/or ERROR logging levels
 - _Comments_: Exceptions and errors may be swallowed: this is an exposure

enter image description here

asked Sep 17, 2019 at 0:53

1 Answer 1

1

Indent your code block to match the indent of your list item. For example:

1. Section one
 1. Item One
 ```java
 code goes here...
 ```
 2. Item two
 3. Item three
2. Section two

Results in:

  1. Section one

    1. Item One

      code goes here...
      
    2. Item two

    3. Item three

  2. Section two

answered Sep 17, 2019 at 1:38
Sign up to request clarification or add additional context in comments.

3 Comments

Hmm I can try that (again - i did several times before) with code blocks - though I would have preferred the code blocks to be all the way to the left I guess that is not supported. On another note: how to do this with links / images? If they are indented it flat out is not working.
Tried the indent for the code block again - still does not work. I'll show in OP
I did some more doctoring and it works now: see the OP. I'll give you the "win" because after the re-work it does function also with the indentation.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.