pygments / pygments/pygments

Explicitly set normal font in CSS

Open
#968 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S-major T-bug X-imported
Dominant language
Python
Stars
2.2k
Forks
885
PR merge metrics
No merged PRs in 30d

Description

(Original issue 1261 created by None on 2016-07-23T18:56:08.160425+00:00)

In the HtmlFormatter, it would be useful to add to _create_stylesheet

if ndef['nobold']:
        style += 'font-weight: normal; '
if ndef['noitalic']:
        style += 'font-style: normal; '

or something along these lines. The problem is that I can put nobold or noitalic in my Pygments style and it will get overwritten by another CSS file.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with HtmlFormatter._create_stylesheet, as identified in the issue, and inspect how the nobold and noitalic style settings are converted into CSS. Done means generated styles explicitly reset font weight and style when those settings are enabled, preventing another stylesheet from overriding them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.