• 
      

    Fix crashes and rendering issues with certain Markdown code blocks.

    Review Request #13129 — Created June 28, 2023 and submitted — Latest diff uploaded

    Information

    Review Board
    release-5.0.x

    Reviewers

    When adding code blocks with certain bits of text (such as a leading
    shebang, Python-Markdown) can go into "line number mode", where it tries
    to render the code blocks with line numbers on the side. A shebang seems
    to trigger this behavior. When in this mode, some assumptions we make
    for Markdown diffing fail, leading to a crash.

    This change forces line numbers to be off, so that we're never in this
    state. Now, all code blocks behave exactly the same way.

    While testing this, I noticed that our rendering of changed code blocks
    for change description entries was incorrect. Code blocks were shifted
    and text was obscured with a background color. At some point, we may
    need to completely rethink the CSS around all of this, but for now, new
    styles have been written to make these flush with the container, fade
    out the background, and include top/bottom borders around the code
    block (which used to exist a few major versions ago).

    Tested with some code samples that formerly caused crashes.

    Unit tests pass.

    Diffed several Markdown code blocks and saw that the results were
    legible.


    Commits

    Files