todo-to-issue-action icon indicating copy to clipboard operation
todo-to-issue-action copied to clipboard

Support Markdown inside of comments

Open adamcagle opened this issue 2 years ago • 2 comments

I noticed that I could use some Markdown syntax in my comments and they would render correctly when the issue was created. I got excited about being able to do this, but as I continued to experiment, I began to get some unexpected results. I've only tried this in R, so I'm not sure if the behavior is different in other languages.

Here are a few examples:

  • adamcagle/todo-action/issues/5
  • adamcagle/todo-action/issues/4
  • adamcagle/todo-action/issues/3

I haven't been able to figure out what the common thread is here. Do you know what characters are safe to use inside the comments and which ones should be avoided? Is this use case something you've considered supporting?

Thanks in advance for any guidance you might be able to provide!

adamcagle avatar Feb 20 '23 00:02 adamcagle

Thanks for the feedback. I haven't tested this at all so it's still uncharted territory. (I have tested using Markdown in ISSUE_TEMPLATE defined in your workflow file, and that may work a bit better, though it's not exactly what you want).

My guess is that the Markdown is potentially causing issues with the regex used to identify comments. The action steps through each line and tries to identify what exactly each one is. For some reason, it seems to think certain lines aren't part of a TODO/comment, so aren't being appended to the body of the issue posted to GitHub. Also, if it thinks that a line is the last line of a TODO, it will end it there and won't look for further ones. When I get chance, I'll step through the examples you provided and see why it's missing lines. If anyone wants to take a look in the meantime, feel free. I think we'll need to escape the input (e.g. characters such as *) to avoid regex issues.

As for the assignees, I'm not exactly sure what the issue is there. I noticed that it was spelt incorrectly originally, but you tried it again and it didn't work? I would have to run some tests but I'm guessing it's the Markdown in the rest of the TODO that's throwing everything out. Try it without the Markdown to confirm.

By the way, indenting subsequent lines of a TODO by a single character is reccommended, but I don't think it will fix the problem.

alstr avatar Feb 20 '23 18:02 alstr

Thanks for taking a look at my issue!

I had tried rerunning it with the corrected spelling of assignees, and it still didn't pick it up.

I went ahead and tried adding single character indentation for subsequent lines as you mentioned just to see what would happen: adamcagle/todo-action/issues/7

The end result was different but still garbled. That said, it did pick up assignees on that attempt.

I also tried dropping all of the Markdown syntax in another run. I thought that would render without issue, but I was suprised by the output that was generated: adamcagle/todo-action/issues/8

adamcagle avatar Feb 20 '23 23:02 adamcagle

There has been some change to improve escaping but if still having issues please let me know.

alstr avatar Jun 28 '24 13:06 alstr