Page MenuHomePhabricator

CSS class is stripped from PRE elements
Closed, ResolvedPublic

Description

Author: mediawiki

Description:
Styling is stripped from "<PRE>" elements when rendered.

I've tried to create a special CSS style to use to show code or commands entered
on a screen. In MediaWiki:Monobook.css, I've added the selector '.sn-screen {
font: normal 100% "Courier New", monospace; background: #DDD; padding: 8pt }'.
In my pages, I use '<pre class="sn-screen"> stuff </pre>'. What actually gets
output to the browser is '<pre> stuff </pre>'--the class, and hence the
associated formatting, is stripped out.

Other elements don't have this problem. For example '<p class="sn-screen">' is
output as expected.

As a workaround, I defined the default formatting for <pre> to be what I want
for screen output ... but then ALL <pre> formatted elements come up the same,
which really isn't what I want.


Version: 1.5.x
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz4264

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:59 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz4264.
bzimport added a subscriber: Unknown Object (MLST).
  • This bug has been marked as a duplicate of 3935 ***
Diffusion added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:15 AM