-
Notifications
You must be signed in to change notification settings - Fork 155
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
add inline comment support #145
base: master
Are you sure you want to change the base?
Conversation
@kovetskiy how did the |
Hi, I've checked the draft version, the problem with |
Also found a problem: Original markdown:
Then select the entire paragraph and comment, OriginalSelection of an inline comment structure will be Actually have no idea how to come up with string replacement in such scenarios which will be quite frequent I suppose. |
good catch. I tried the case you mentioned. In MergeComments, on the input, I got |
i'll create some test cases for these. |
That's strange since I've got OriginalSelection to be I'm not sure if string replacement is really a good way to handle the issue. |
the alternative I thought about was xml path, however, since everything starts with |
i also got OriginalSelection as |
the other approach is to download the original body.storage, and compare with the current one to inject the marker, but that is much harder, as it's diffing 2 xml documents... |
@kovetskiy i think about this more. yes, there is no way to fix this ONLY by string comparison. Fundamentally, there is no way we could solve this accurately as the user's edition is a lossy info to us. I think there should be 2 approaches together
Thoughts? |
@guoweis-outreach I didn't really come up to any ideas that wouldn't require a lot of work. Maybe we could just lock page for comments so people would need to comment the entire page in the comments section instead? |
@kovetskiy i think this one is important. I used mark to sync, but whenever someone comments on the page, I get afraid to update the page with mark as I'm worry that I'll lose it. Turning off the ability to comment inline can work but it causes lot of inconvenience. I wonder as the first step, does it make sense to create a way to sync the comment from confluence to the markdown? ie. If we could create a syntax to mark the inline comment in the markdown file, and safely preserve it, then at least people won't feel worry about losing valuable comments. something like this
Thoughts? |
Tbh: I'm not a hard-core confluence user and never will be. So maybe I miss the point of inline comments. Maybe it would be best to not allow a push when comments are in the page Maybe the comments have to be integrated somehow into the markdown and removed from the page first? I'm thinking here about comments which point to mistakes in the page or missing stuff. But as said: Maybe I have too less a clue of how confluence is intended to be used. |
I have started on this similar problem in my project. Might provide some inspiration for you when looking at how to find where to put comments. https://github.com/markdown-confluence/markdown-confluence/blob/main/packages/lib/src/AdfProcessing.ts#L285-L500 I am using https://en.wikipedia.org/wiki/Levenshtein_distance calculation on the text around the comment to find the "best" place to put it back. Need to add in the same for when you modify the comment text. |
This is the output from cloud