Editable comments on suggestions#656
Merged
florentc merged 5 commits intoNixOS:mainfrom Nov 24, 2025
Merged
Conversation
balsoft
reviewed
Nov 17, 2025
YorikSar
reviewed
Nov 17, 2025
|
|
||
| def additional_comment() -> str: | ||
| if comment: | ||
| escaped_comment = comment.replace("`", "\\`") |
There was a problem hiding this comment.
This will turn ` into
```
\`
```
Which renders as
\`
To escape triple backticks, you need more backticks around the block:
````
```
````
renders as
```
(yes, I added 5 backticks before and after to show this)
YorikSar
reviewed
Nov 21, 2025
|
|
||
| # Use at least 3 backticks, or one more than the maximum found in | ||
| # order to escape accidents or attempts at escaping the code block | ||
| fence_backticks = "`" * max(3, max_backticks + 1) |
There was a problem hiding this comment.
This is fine, and I know that fixing a problem with a regex doubles the problem, but iterating over a comment in Python seems scary to me. This could also work to count backtick runs:
max(m.end() - m.start() for m in re.finditer('`+', comment))
YorikSar
approved these changes
Nov 21, 2025
YorikSar
left a comment
There was a problem hiding this comment.
Ah, posted the comment too soon. I'm fine with this implementation as well.
dc452ae to
8c773c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses #654 and #621.
WARNING
This PR adds a db migration that should be applied after #655 is merged (or after editing the migration numbers accordingly).
Comment section
Error when dismissing without a comment
Comments are highlighted to easily notice they are non empty
Comments are saved when status is changed
Published issues show the comment
On sec-tracker
On GitHub (nixpkgs)