12

I have a problem with editing this question: Upgrade to 18.04, now sudo apt-get upgrade produces loads of insserv errors

OP didn't format the terminal output (which as you can see, is really long), so I just used the preformatted text code option as I usually do, but there is a problem. After adding the formatting, the number of characters is over the 30,000 limit, and I've got something like 30 840, so all around 840 more than accepted.

I removed some parts of the output (which I replaced with [...] with a note at the bottom to explain), and I would like to know if there is a better way to avoid this problem.

1 Answer 1

10

This is indeed an annoying problem.

I think your edit removing some parts of the output which were unnecessary was fine. It was also a good idea to leave a note of what you had removed, because anything you've taken out will always be available in the revision history. I handled your edit suggestion and I actually removed those parts because I don't think they had any useful information in them anyway (but maybe I was overzealous).

This problem also occurs when formatting output from scripts like the wireless info script and boot repair info. Output that is too long can be dumped in a pastebin such as paste.ubuntu.com, but it's always preferable to have the information in the post if possible.

The reason the automatic pre formatting makes the output too long is that it inserts 4 space characters before each line. This adds lines*4 characters to the count. As a workaround, you can use html tags:

<pre><code>lines of formatted text
go here
between the tags</code></pre>

This works without indenting, so you don't need to add 4 spaces per line.

However, you need to check the text, because within these tags, other html tags will still work, instead of rendering literally. For example...

Indenting shows tags:

<i>indented words</i>

The syntax <pre><code><i>preformatted words</i></code></pre> prints this, when not indented:

preformatted words

So check the text for anything that may cause unexpected text formatting when doing this (obviously it's great when you actually want to add formatting).

2
  • 2
    If only SE would implement fenced markdown, it would almost solve this issue completely :(
    – Dan
    Commented Aug 8, 2018 at 13:40
  • 1
    @Dan status-completed
    – Kulfy
    Commented Dec 27, 2019 at 19:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .