• 
      

    Allow markdown code in Reviews to be selected

    Review Request #14144 — Created Sept. 5, 2024 and discarded

    Information

    Review Board
    release-7.x

    Reviewers

    • Previously the markdown code for reviews and descriptions
      were not able to be highlighted which meant you could only
      select the entire inline code block by starting the
      selection from outside of the block
    • This change allows you to select text within inline code blocks
    • This was due to the before psuedo element which would block
      the whole markdown element
    • Manual testing of added reviews and descriptions of review requests
    Summary ID Author
    Fix references in the release notes.
    The new release notes had a few holdovers from the backport from 6.0.2. This is a trivial change to update some aspects of the documentation for this release of Review Board.
    868ecded311ca5d97c621137910f317dc0ac6f61 Christian Hammond
    Allow markdown code in Reviews to be selected
    - Previously the markdown code for reviews were not able to be highlighted which meant you could only select the entire inline code block by starting the selection from outside of the block - This change allows you to select text within inline code blocks - This was due to the `before` psuedo element which would block the whole markdown element
    8cdb89573c7bdcc6b05b0ebb0ccb7c9177005ed4 Raymond Lam
    Description From Last Updated

    We should be a bit more specific in the review request description. It should be noted that this change allows …

    maubinmaubin

    At this point, 6.x is mostly in security-fix mode. Can we move the change over to the release-7.x branch?

    daviddavid

    It took me a while to circle to this and dig in, but I think I understand the core problem …

    chipx86chipx86

    This is reverting back to @inline-code-border-color. On 7.0+, we'll need to use var(--ink-p-code-literal-border-color), since this is required for dark mode.

    chipx86chipx86
    david
    1. This is definitely something I can reproduce, and your change fixes it, but I'm truly at a loss about why the .codehilite rules (for multiline code blocks) which are virtually identical to this do not suffer from the same issue. Any theories?

      1. I'm not too sure if we're referencing the same thing, but if you're talking about the triple backticks then the issue still persists for me

    2. Show all issues

      At this point, 6.x is mostly in security-fix mode. Can we move the change over to the release-7.x branch?

    3. 
        
    maubin
    1. I tested out this patch and it looks good! Thanks for the change. I just have one suggestion for the review request description.

    2. Show all issues

      We should be a bit more specific in the review request description. It should be noted that this change allows you to select text within inline code blocks. Previously, you could only select the entire inline code block by starting the selection from outside of the block.

    3. 
        
    OfficeStapler
    OfficeStapler
    OfficeStapler
    chipx86
    1. 
        
    2. Show all issues

      It took me a while to circle to this and dig in, but I think I understand the core problem now. The code::before, being absolutely-positioned, ends up stacking above the text element below it. This ends up capturing pointer events on the element, including the selection. Since it doesn't contain the text itself, there's nothing to show selected.

      The outline approach can solve this, but just in the name of simplicity and keeping things from changing too much, can I have you try one thing?

      If you switch back to upstream and add this, does it solve it for you?

      &:before {
        ...
      
        pointer-events: none;
      }
      
      1. I've done it in a new review_request (due to issues involving the rbt tool, https://reviews.reviewboard.org/r/14183/)

    3. Show all issues

      This is reverting back to @inline-code-border-color. On 7.0+, we'll need to use var(--ink-p-code-literal-border-color), since this is required for dark mode.

      1. I've done it in a new review_request (due to issues involving the rbt tool, https://reviews.reviewboard.org/r/14183/)

    4. 
        
    OfficeStapler
    Review request changed
    Status:
    Discarded