Fix code blocks in wiki
Open, HighPublic

Description

Some of the code blocks in the Apertus Wiki dont preserve the newlines and are impossible to read.
Example: https://wiki.apertus.org/index.php/AXIOM_Beta/Manual#EEPROM
How can we fix this?

jatha created this task.Jan 1 2018, 9:44 PM
jatha updated the task description. (Show Details)
jatha raised the priority of this task from to High.
jatha added a subscriber: jatha.
jatha added subscribers: sebastian, RexOr.
RexOr added a comment.Jan 1 2018, 10:00 PM

I'll leave that till you see Sebastian, in case you have something in mind, and I can't remember how it was, but it looks to me like this should be bulletted as opposed to a code block.

jatha added a comment.Jan 1 2018, 10:42 PM

another example: https://wiki.apertus.org/index.php/Beta_Power_Board#Calibrating-Voltages
I think, that <nowiki></nowiki> should preserve newlines

BAndiT1983 added a subscriber: BAndiT1983.EditedJan 1 2018, 11:00 PM

Added the test code from sandbox, please check if it's better suited.

Edit: I've meant https://wiki.apertus.org/index.php/Beta_Power_Board#Calibrating-Voltages

This is indeed a problem we discovered when switching from the old wiki to the most current build.

The fix we found is to use slightly different tags for multi line code blocks:

Examples before/after here: https://wiki.apertus.org/index.php/Sandbox

It requires manually cleaning those affected pages though.

jatha added a comment.Jan 1 2018, 11:32 PM

can we make this behaviour default for the nowiki snippets?

good question, will need research.

One thing we might be able to do is add a custom button in the wiki editor that inserts this tag probably...

Or we can add just a simple script/plugin which looks for some special marker and replaces the HTML code for the section. Like $ for bash commands.

I looked into that already and it doesn't seem trivial to do with mediawiki, but maybe I searched for the wrong thing. Please check.

Maybe like examples from this page: https://www.mediawiki.org/wiki/Manual:Tag_extensions

Still looking for some thorough tutorial or example.

Looks helpful indeed.
Anyone up for writing a small mediawiki extension?