A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/django-wiki/django-wiki/issues/601 below:

Code block that uses backticks with numbering has inconsitent formatting and highlighting compared to regular code blocks · Issue #601 · django-wiki/django-wiki · GitHub

When creating code blocks in wiki pages, and Pygments library is available, code blocks are highlighted in slightly different way, with line numbering being shown to the left of each line.

A recent changeset has fixed some rendering issues related to such output, but the styling and formatting is not consistent with regular code blocks. This happens mainly with back-tick style code block syntax, although some inconsistencies exist with regular (4-space indent) code block syntax as well.

Reproduction steps:

  1. Set-up Django Wiki, making sure that Pygments library is available.

  2. Create page with the following content:

This results in line-numbered code block:

```
#!/bin/bash

echo "This is one really big line that is going to be so long that it will not be able to fit into the margins of the window, and horisontal scrollbar will be needed."
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
```

This results in regular line-numbered code.

```
echo "This is one really big line that is going to be so long that it will not be able to fit into the margins of the window, and horisontal scrollbar will be needed."
echo 1
echo 1
echo 1
echo 1
echo 1
echo 1
```

Expected results:

  1. Line-numbered code block is same width on-screen as regular code block and has a horisontal scroll-bar.

  2. Line-numbered code block has same background colour as regular code block.

  3. Line-numbered code block is the same height as regular code block and has a vertical scrollbar.

Actual results:

  1. Line-numbered code block is not limited in width, making the HTML page wide enough so that scrollbars will kick in on the page itself (instead of only the code block). This can be particularly annoying on mobile views (see attached screenshots).


  1. Line-numbered code block does not have the same background colour as the regular one - it maintains the default page colour instead of grey.

  2. Line-numbered code block never gets a vertical scroll-bar, no matter how long it is. This can be considered both advantage or disadvantage depending on how you look at it, though.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4