Reply tool can't be used for comments that start with {{od}}{{re|…}} and similar markup. The error message is "The "reply" link cannot be used to reply to this comment". (Originally reported at T312828#8076979 by @Novem_Linguae)
For example, the last comment at https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:New_pages_patrol/Coordination&oldid=1098068027 is like this:
{{od}}{{re|MB|Novem Linguae}} ... 02:00, 14 July 2022 (UTC)
Which results in Parsoid rendering like this: https://en.wikipedia.org/api/rest_v1/page/html/Wikipedia_talk%3ANew_pages_patrol%2FCoordination/1098068027 (prettified below)
<div class="outdent-template" style="position:relative;left:1px;" about="#mwt44" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"od","href":"./Template:Od"},"params":{},"i":0}}]}' id="mwAUM"> <span style="display:block;width:16em;height:0.5em;border-bottom:1px solid #a2a9b1;border-right:1px solid #a2a9b1;"></span> <span style="display:block;width:16em;height:0.5em;border-left:1px solid #a2a9b1;"></span> </div> <p about="#mwt45" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"re","href":"./Template:Re"},"params":{"1":{"wt":"MB"},"2":{"wt":"Novem Linguae"}},"i":0}}," ..."]}' id="mwAUQ"> <span class="template-ping">@<a rel="mw:WikiLink" href="./User:MB" title="User:MB">MB</a> and <a rel="mw:WikiLink" href="./User:Novem_Linguae" title="User:Novem Linguae">Novem Linguae</a>:</span> ... </p>
What happens here:
- In Parsoid:
- The {{od}} template markup is placed outside of a paragraph, because it's a <div>
- Therefore the markup following it has to generate the opening paragraph tag
- Because this markup is a template, the opening paragraph tag is considered to be generated by a template
- This forces the whole paragraph to be considered to be generated by a template
- We now have a multi-part transclusion, consisting of the {{re}} template and the wikitext following it
(You can see that this happens easily by opening the page in visual editor – https://en.wikipedia.org/w/index.php?title=Wikipedia_talk:New_pages_patrol/Coordination&oldid=1098068027&veaction=edit – and highlighting the transclusion:)
- In DiscussionTools:
- The {{od}} template is not part of the comment, we have a special-case for it: https://github.com/wikimedia/mediawiki-extensions-DiscussionTools/blob/32d4d879a8f7cb1a791cbf5f7d0f4529b5f952d3/includes/CommentUtils.php#L152-L153 (to avoid issues with mis-detecting indentation that would occur otherwise)
- The detected range of the comment therefore almost exactly matches the range of the multi-part transclusion ("almost exactly" is a… technical term)
- When that happens, we always make it impossible to reply to the comment, out of abundance of caution: https://github.com/wikimedia/mediawiki-extensions-DiscussionTools/blob/32d4d879a8f7cb1a791cbf5f7d0f4529b5f952d3/includes/ThreadItem.php#L227-L229 – because it's a weird edge case and when writing that code, I didn't have a good idea for what the expected behavior should be.
It's likely that this behavior could be changed – in a similar scenario where the transclusion is just a single template, we make the reply tool reply on the same page, because usually it's just some wrapper template (example). It'd be good to find some more examples where the current behavior does or doesn't work.