We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

[bug] <code> formatted incorrectly in list items even with <pre>

asked 2015-04-28 18:21:40 +0300

chemist gravatar image

updated 2015-04-28 19:13:24 +0300

Following up on https://together.jolla.com/question/2335/code-in-answers-is-formatted-incorrectly/

with issues of \ in general but especially in lists

Standard

Formatting with leading spaces (not possible in lists)

 sed -i "/nemo\\\devicelock\\\maximum_attempts=/c\nemo\\\devicelock\\\maximum_attempts=-1" /mnt/usr/share/lipstick/devicelock/devicelock_settings.conf

Formatting with ` sed -i "/nemo\\\devicelock\\\maximum_attempts=/c\nemo\\\devicelock\\\maximum_attempts=-1" /mnt/usr/share/lipstick/devicelock/devicelock_settings.conf

Formatting with <code> sed -i "/nemo\\devicelock\\maximum_attempts=/c\nemo\\devicelock\\maximum_attempts=-1" /mnt/usr/share/lipstick/devicelock/devicelock_settings.conf

Formatting with <pre><code>

sed -i "/nemo\\\devicelock\\\maximum_attempts=/c\nemo\\\devicelock\\\maximum_attempts=-1" /mnt/usr/share/lipstick/devicelock/devicelock_settings.conf

List items

Formatting with ` in a list item

  1. sed -i "/nemo\\\devicelock\\\maximum_attempts=/c\nemo\\\devicelock\\\maximum_attempts=-1" /mnt/usr/share/lipstick/devicelock/devicelock_settings.conf

Formatting with <code> in a list item

1. sed -i "/nemo\\devicelock\\maximum_attempts=/c\nemo\\devicelock\\maximum_attempts=-1" /mnt/usr/share/lipstick/devicelock/devicelock_settings.conf

Formatting with <pre><code> in a list item

  1. sed -i "/nemo\\devicelock\\maximum_attempts=/c\nemo\\devicelock\\maximum_attempts=-1" /mnt/usr/share/lipstick/devicelock/devicelock_settings.conf
edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
2

answered 2015-04-30 10:56:08 +0300

Keto gravatar image

You can put indented code block in list item but it needs to be indented twice, i.e. 8 spaces

  1. like this

    1. list
    
            code goes here \\\
    
  2. and the list continues

It is a bit cumbersome, but that's how it is in the markdown spec.

The inline code looks bad because it is not meant for very long lines, I'll see if that could be improved somehow. And the code blocks probably should not wrap the content and instead provide a scrolbar if it does not fit.

edit flag offensive delete publish link more

Comments

so "2nd P + code-indent", ok still <code> wraps changes \\\ to \\

chemist ( 2015-04-30 12:10:35 +0300 )edit

needed 4 attempts to write that above!

chemist ( 2015-04-30 12:11:52 +0300 )edit
Login/Signup to Answer

Question tools

Follow
1 follower

Stats

Asked: 2015-04-28 18:21:40 +0300

Seen: 357 times

Last updated: Apr 30 '15