Allow markdown code in Reviews to be selected
Review Request #14144 — Created Sept. 5, 2024 and discarded
- 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 |
---|---|---|
868ecded311ca5d97c621137910f317dc0ac6f61 | Christian Hammond | |
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 … |
maubin | |
At this point, 6.x is mostly in security-fix mode. Can we move the change over to the release-7.x branch? |
david | |
It took me a while to circle to this and dig in, but I think I understand the core problem … |
chipx86 | |
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. |
chipx86 |
-
I tested out this patch and it looks good! Thanks for the change. I just have one suggestion for the review request description.
-
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.
- Description:
-
~ - Previously the markdown code for reviews were not able to be
highlighted
~ - This was due to the
before
psuedo element which would block
the whole markdown element
~ - 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
- Previously the markdown code for reviews were not able to be
- Commits:
-
Summary ID Author eb88047cc3382791029851e1eef523675e11db29 Raymond Lam 868ecded311ca5d97c621137910f317dc0ac6f61 Christian Hammond 2ac4a9b1bb067b4c5aeb4873b3362b0962bb3a4b Raymond Lam - Branch:
-
release-6.xrelease-7.x
Checks run (2 succeeded)
- Commits:
-
Summary ID Author 868ecded311ca5d97c621137910f317dc0ac6f61 Christian Hammond 2ac4a9b1bb067b4c5aeb4873b3362b0962bb3a4b Raymond Lam 868ecded311ca5d97c621137910f317dc0ac6f61 Christian Hammond 8cdb89573c7bdcc6b05b0ebb0ccb7c9177005ed4 Raymond Lam - Diff:
-
Revision 3 (+12 -32)
Checks run (2 succeeded)
- Description:
-
~ - 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
~ - 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
- Previously the markdown code for reviews were not able to be
-
-
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; }
-
This is reverting back to
@inline-code-border-color
. On 7.0+, we'll need to usevar(--ink-p-code-literal-border-color)
, since this is required for dark mode.