Fix code blocks in wiki
Open, HighPublic


Some of the code blocks in the Apertus Wiki dont preserve the newlines and are impossible to read.
How can we fix this?

anuejn created this task.Jan 1 2018, 9:44 PM
anuejn updated the task description. (Show Details)
anuejn raised the priority of this task from to High.
anuejn added a subscriber: anuejn.
anuejn 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.

another example:
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

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:

It requires manually cleaning those affected pages though.

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:

Still looking for some thorough tutorial or example.

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