Skip to content

Lexer not recognising CSS variables. #1666

@carltongibson

Description

@carltongibson

Hi, sorry to open an issue without a suggested fix.

We added an example code block using CSS variables to the Django docs:

.. code-block:: html+django

    {% extends 'admin/base.html' %}

    {% block extrahead %}{{ block.super }}
    <style>
    :root {
      --primary: #9774d5;
      --secondary: #785cab;
      --link-fg: #7c449b;
      --link-selected-fg: #8f5bb2;
    }
    </style>
    {% endblock %}

This raises an warning rendering:

django/docs/ref/contrib/admin/index.txt:2815: WARNING: Could not lex literal_block as "html+django". Highlighting skipped.

Looks like it's the -- variables in the <style> element that can't be handled.

Thanks for all your work and efforts! 🏅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions