-
Notifications
You must be signed in to change notification settings - Fork 13
Editable comments on suggestions #656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
src/shared/github.py
Outdated
|
|
||
| def additional_comment() -> str: | ||
| if comment: | ||
| escaped_comment = comment.replace("`", "\\`") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solved in dc452ae
|
|
||
| # 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, posted the comment too soon. I'm fine with this implementation as well.
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)