Opened 7 years ago
Last modified 7 years 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 )
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:
- 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.
- 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)
Change History (10)
by , 7 years ago
Attachment: | help-pre-format-line-break.png added |
---|
comment:1 by , 7 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 18.02 |
comment:3 by , 7 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 , 7 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 , 7 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:7 by , 7 years ago
Keywords: | html added |
---|---|
Milestone: | 18.02 → 18.03 |
follow-up: 9 comment:8 by , 7 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 }
comment:9 by , 7 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.
Replying to Hb---:
This point will be impossible to fix. Swing does not provide colour syntaxing highlight for programming languagesIt should possible by CSS :)