markup icon indicating copy to clipboard operation
markup copied to clipboard

Auto add 4 ticks for suggestions when selected review contains ticks

Open SerratedSharp opened this issue 1 year ago • 2 comments

If I click and drag multiple lines in a PR to create a Review, then choose to create a suggestion in the Review, then the prefilled block of code gets wrapped in a suggestion block:

```suggestion
code
```

However if "code" contains three ticks already, this won't work. You could automatically detect that the selected code contains a triple tick upon clicking the add Suggestion button, and use four ticks for the suggestion block, which will resolve the issue.

SerratedSharp avatar Aug 04 '24 03:08 SerratedSharp

Stale issue message

github-actions[bot] avatar Oct 03 '24 12:10 github-actions[bot]

I'll clarify this is more commonly a problem when doing PR reviews for documentation repos, as these are *.md files or contain markdown, so the likelhood of nested ticks is alot more common. On first encountering this, the resulting mangled output is very confusing, and if you don't know about the rule for using additional ticks on outer wrapping ticks, then the solution is non-obvious.

The other thing to note: This isn't me as a user making a mistake in hand coding markdown. This is a built-in Github functionality that generates the invalid PR review suggestion markdown.

SerratedSharp avatar Oct 07 '24 00:10 SerratedSharp

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 14 '25 12:02 github-actions[bot]