#4767 Omit breaking original comment format in reply
Merged by pingou. Opened by lholecek.
lholecek/pagure fix-reply-format  into  master

Download 4767.patch

This fixes replying to a comment with block quotes and other formatted
text by prefixing each line in the original Markdown text with > to
create additional quotation level. Previously, this was done on the
rendered Markdown, but it removed the formatting.

In some cases, the Markdown rendering can be still broken, for example
code blocks using triple backticks. From Python-Markdown documentation
[1]:

Fenced Code Blocks are only supported at the document root level.
Therefore, they cannot be nested inside lists or blockquotes.

[1] https://python-markdown.github.io/extensions/fenced_code_blocks/

Fixes #2479

Signed-off-by: Lukas Holecek hluk@email.cz

rebased onto 46a4c3afa35f8545a3919e79d0f59bed57ed870e

rebased onto 6e2999854a01920bff81623815c3a909ced448f4

rebased onto 73148ce40581c3b1cdcebd32a25c68844f855671

rebased onto 7182117a5e98ee4c08a3a7dd09724d1ea30185e3

1 new commit added

  • Move js code to set up reply buttons from html

:thumbsup:

:thumbsup:

I like the idea but I find the implementation a little heavy, imagine a ticket with many comments that include for example java tracebacks, you would end up downloading a lot of information for basically no use.

I wonder if we shouldn't add an API that would return a specific comment instead of the entire ticket, it would make this process a little more light weight.

1 new commit added

  • Add API endpoint to get a pull-request comment

I wonder if we shouldn't add an API that would return a specific comment instead of the entire ticket, it would make this process a little more light weight.

I've added API endpoint to get specific comment for PR (similar to the existing endpoint for getting issue comments).

Any idea how to do this for initial comment in PR and issue description?

Any idea how to do this for initial comment in PR and issue description?

What about using an argument to the existing API endpoint to not include the comments?

1 new commit added

  • Avoid fetching all comments when replying

What about using an argument to the existing API endpoint to not include the comments?

Done. :)

There was already comments=false to avoid fetching comments when with issue data.

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

We may need to check somewhere that the ticket is not private or that the user accessing it is allowed to

Looks good to me, I think we just need to cover the private issue/PR aspect and we should be set :)

1 new commit added

  • Fix getting private PR data

5 new commits added

  • Fix getting private PR data
  • Avoid fetching all comments when replying
  • Add API endpoint to get a pull-request comment
  • Move js code to set up reply buttons from html
  • Omit breaking original comment format in reply

Looks good, I'd like to give it a run locally and we should be able to get this in :)

rebased onto 9862697eb41320ccc8236c84cc446d6ad5935aba

The tests are failing but due to a styling issue apparently

I have opened https://pagure.io/pagure/pull-request/4939 with the exact same content but (in theory) not the style issues. This will allow to get it in this week-end and in time for 5.11 :)

Commit 54ea723c fixes this pull-request

Pull-Request has been merged by pingou

Metadata