Skip to content

RestructuredText: warning and note directives are not properly rendered #1682

Description

@berndschatz

text of warning / note directives should be rendered in a box or/and in another color.

Currently it looks like this:

note

This is a note

but it should look somehow like here -->

2023-04-11-114318_1088x130_scrot

see also -->
https://sublime-and-sphinx-guide.readthedocs.io/en/latest/notes_warnings.html

IMHO this would be a big improvement for the readability of technical documentation with less effort for you for the implementation.

Activity

  1. changed the title [-]RestructuredText directives warning and note directives are not properly rendered on github[/-] [+]RestructuredText: warning and note directives are not properly rendered on github[/+] on Apr 11, 2023
  2. changed the title [-]RestructuredText: warning and note directives are not properly rendered on github[/-] [+]RestructuredText: warning and note directives are not properly rendered[/+] on Apr 11, 2023
  3. ichordev commented on Jul 23, 2023

    @ichordev

    Notes used to render with a little blue "info" icon, and warnings with a little yellow "warning" icon... but not anymore.

  4. berndschatz commented on Mar 19, 2024

    @berndschatz
    Author

    Maybe this broke it? https://github.blog/changelog/2023-12-14-new-markdown-extension-alerts-provide-distinctive-styling-for-significant-content/

    This is markdown (that is designed for small blog entries),
    we use/need RestructuredText (that is designed for technical documentation).

  5. flying-sheep commented on Mar 19, 2024

    @flying-sheep
    Contributor

    Hold your horses, I’m with you haha. In this community discussion, they describe that they broke the rendering for the old markdown way of doing admonitions.

    What I’m implying (but could have been clear about) is that maybe they still make rST render to whatever intermediate representation the old Markdown syntax rendered to and that way broke it?

    Or maybe they never supported it, I don’t remember. Since they do support admonition rendering in Markdown, they should make rST and Asciidoc admonitions render the same way.

  6. berndschatz commented on Mar 19, 2024

    @berndschatz
    Author

    Don't know what they do, the docutils works fine, so i assume they have some own stuff: post/pre-processor
    before / after using the docutils !?
    Or do they implement a complete own ResT parser !?

    PS: Regarding automated testing, there are probably still a few areas for improvement for ResT (and markdown):

  7. github-actions commented on Jul 15, 2024

    @github-actions

    Stale issue message

  8. flying-sheep commented on Jul 20, 2024

    @flying-sheep
    Contributor

    Not-a-stale-issue response

    @humans please pin and make the bot go away thanks

  9. ErraticMaker commented on Jul 30, 2024

    @ErraticMaker

    Just for reference #68 was closed several years ago, because at the time it couldn't be implemented. I'm hoping that things have changed enough since then that'll be possible to provide the same experience to ReST than it is available with GFM.

  10. github-actions commented on Sep 29, 2024

    @github-actions

    Stale issue message

  11. flying-sheep commented on Sep 30, 2024

    @flying-sheep
    Contributor

    Still not stale. Please please add a label that shuts up the bot!

  12. flying-sheep commented on Nov 18, 2024

    @flying-sheep
    Contributor

    @jmeridth could you please take a look here? Either #68 needs to be reopened or this needs to be triaged and labelled correctly.

    The closing reason for #68 is no longer valid

  13. added
    keepLabel to avoid being marked as stale
    on Nov 18, 2024
  14. jmeridth commented on Nov 18, 2024

    @jmeridth
    Contributor

    @jmeridth could you please take a look here? Either #68 needs to be reopened or this needs to be triaged and labelled correctly.

    The closing reason for #68 is no longer valid

    @flying-sheep Taking a look. I've also added the keep label to avoid being flagged by the stale bot. Thanks for the bump.

  15. evdcush commented on Dec 30, 2025

    @evdcush

    Related discussions, issues:

    "No one seems to mention that so far: is the root cause of all these due to GitHub switched from using sphinx to render rst to using pandoc to convert rst to md (or similar) and render from there?"


  16. megapatato commented on Feb 15, 2026

    @megapatato

    When editing wiki pages, the GitHub user interface has an Edit mode: drop-down menu that includes the reStructuredText option; it's been years since this issue was opened, but that official edit mode remains partially broken?

  17. zkoppert commented on Apr 24, 2026

    @zkoppert
    Member

    Thanks for the report, and thanks for the detailed examples.

    After investigating, this repo's RST renderer (via docutils) does generate correct semantic HTML for admonitions — including proper class="admonition note" and class="admonition warning" attributes. The raw HTML output from this gem is correct.

    However, the issue is in step 2 of the rendering pipeline: GitHub's HTML sanitizer aggressively strips class and id attributes. Check out this part of the README for a fuller picture:

    The HTML is sanitized, aggressively removing things that could harm you and your kin — such as script tags, inline-styles, and class or id attributes.

    Without those class attributes, the admonitions render as plain unstyled <div> elements. This is a downstream sanitization/styling issue that this repo can't address — the correct HTML is being generated, but it's stripped before display.

    For admonition styling support, GitHub's feedback discussions would be the right venue to request that the sanitizer preserve or re-add admonition classes.

    Closing as out of scope for this repository.

  18. flying-sheep commented on Apr 24, 2026

    @flying-sheep
    Contributor

    @zkoppert already exists, can you please elevate that to an internal issue/task? https://github.com/orgs/community/discussions/45829

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    keepLabel to avoid being marked as stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions