Modify

Opened 14 months ago

Last modified 13 months ago

#15998 new defect

<pre> needs background-color and the syntax-highlighter checked

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

Description (last modified by Don-vip)

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 two 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, especcially the orange coloured marks for missing line breaks:


Attachments (1)

help-pre-format-line-break.png (106.7 KB) - added by Hb--- 14 months ago.

Download all attachments as: .zip

Change History (10)

Changed 14 months ago by Hb---

comment:1 Changed 14 months ago by Don-vip

Description: modified (diff)
Milestone: 18.02

comment:2 in reply to:  description Changed 14 months ago by Don-vip

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 14 months ago by Don-vip (previous) (diff)

comment:3 in reply to:  description Changed 14 months ago by Don-vip

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 Changed 14 months ago by Hb---

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 Changed 14 months ago by Don-vip

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 Changed 14 months ago by Don-vip

In 13459/josm:

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

comment:7 Changed 14 months ago by Don-vip

Keywords: html added
Milestone: 18.0218.03

comment:8 Changed 14 months ago by Jun Omae <jun66j5@…>

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

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

comment:9 in reply to:  8 Changed 13 months ago by Don-vip

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to Hb---
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.