Opened 8 years ago

Last modified 8 months ago

#15998 new defect

<pre> needs background-color — at Version 10

Reported by: Hb--- Owned by: team
Priority: trivial Milestone:
Component: Core Version:
Keywords: help html trac css Cc:

Description (last modified by Hb---)

Wiki text inside three curly brackets {{{is delivered as <code>if no line break</code> or as

<pre>when the brackets start the line.</pre>

This variant allows syntax-highlighting with Wiki Processors.

<code> is since #15910 well displayed within the limits of the Help Browser.

<pre> has twoone remaining issues:

  1. The formatting of the area lacks of a background-color (and a border, if possible). The area should look the same as in a normal web browser.
  2. The result of the #!sh syntax-highlighter is wrong, i.e.
    • the line break after comment lines gets lost and
    • the colour for highlighted words gets lost too.

See the screenshot with the remaining issue in comment 10, especially the orange coloured marks for missing line breaks:


Change History (12)

by Hb---, 8 years ago

comment:1 by Don-vip, 8 years ago

Description: modified (diff)
Milestone: 18.02

in reply to:  description comment:2 by Don-vip, 8 years ago

Replying to Hb---:

  • the colour for highlighted words gets lost too.

This point will be impossible to fix. Swing does not provide colour syntaxing highlight for programming languages

It should possible by CSS :)

Last edited 8 years ago by Don-vip (previous) (diff)

in reply to:  description comment:3 by Don-vip, 8 years ago

Replying to Hb---:

  • the line break after comment lines gets lost and

I think Java behaviour is correct here. The line break is not inside the <pre> but inside a nested <span>. It might be a Trac bug.

comment:4 by Hb---, 8 years ago

TracSyntaxColoring deliveres CSS like <span ...>code line <0A linefeed here></span> . Probably the Java HTML Viewer cannot display a span as block element. But all other browsers can do this.

Probably even Pygments is to blame.

comment:5 by Don-vip, 8 years ago

Created bugeport: https://trac.edgewall.org/ticket/12984 Let's see what they say. Fun thing: the HTML code is correct in the bug report

comment:6 by Don-vip, 8 years ago

In 13459/josm:

see #15998 - improve rendering of code snippets in help browser

comment:7 by Don-vip, 8 years ago

Keywords: html added
Milestone: 18.0218.03

comment:8 by jun66j5, 8 years ago

I believe that is Java HTML viewer's issue. How about adding the following for workaround (untested)?

div.code pre span { white-space: pre }

in reply to:  8 comment:9 by Don-vip, 8 years ago

Keywords: trac css added
Milestone: 18.03

Replying to Jun Omae <jun66j5@…>:

How about adding the following for workaround (untested)?

div.code pre span { white-space: pre }

It doesn't work. Swing CSS capabilities are very limited. Let's see if the next Trac update solves our problem.

by Hb---, 8 months ago

Attachment: 20250806 bug 15998.png added

comment:10 by Hb---, 8 months ago

Description: modified (diff)
Priority: minortrivial
Summary: <pre> needs background-color and the syntax-highlighter checked<pre> needs background-color

Meanwhile the new Trac version used by JOSM has solved the issue number 2. The line break character is now placed after the </span>. Syntax colours are displayed too now, probably by DonVip's fix in comment 6.


Note: See TracTickets for help on using tickets.