diff --git a/internal/forge/jira/adf.go b/internal/forge/jira/adf.go index 4236075b7c..dd32916188 100644 --- a/internal/forge/jira/adf.go +++ b/internal/forge/jira/adf.go @@ -114,13 +114,10 @@ func adfBlockContent(parent ast.Node, source []byte, depth int, restricted bool) for c := parent.FirstChild(); c != nil; { // In non-restricted context, attempt to convert
// HTML blocks into ADF expand nodes. tryDetailsExpand - // handles both single-block (no blank lines inside the - // markup) and multi-block (blank lines split the
- // opening, body, and closing across several AST siblings) - // forms, since comments posted by pre-#9334 CLIs — which - // folded prior results into
blocks — produce the - // latter while hand-written Markdown typically produces the - // former. + // handles both single-block and multi-block
+ // markup — the multi-block form is blank lines inside + // the markup splitting it across AST siblings (see its + // doc for the full layout description). if !restricted { if expand, next := tryDetailsExpand(c, source, depth); expand != nil { content = append(content, expand) @@ -146,12 +143,15 @@ var summaryInnerTagPattern = regexp.MustCompile(`<[^>]*>`) // stickyHistorySentinelPattern matches sticky history sentinel comments // on their own line, for stripping from
body content before -// re-parsing as Markdown. Pre-#9334 CLIs wrapped the history they folded -// into
blocks with these sentinels; comments those CLIs posted -// still sit unedited on old pull requests, and the sentinels must not -// become visible text inside the rendered ADF expansion. Kept as a -// read-side shim until such comments have aged out of the threads Jira -// quotes (#9517 removed the machinery that wrote them). +// re-parsing as Markdown. The sentinels are metadata, not content: the +// sticky history folding wrote them when it collapsed an older comment +// body into a new one, and #9517 removed that machinery. GitHub and +// GitLab comments keep that Markdown verbatim, and a Jira comment +// written before
blocks were mapped to expand nodes can hold +// a sentinel as literal text, so a body quoted from an older comment +// can still carry them. They must not become visible text inside the +// rendered ADF expansion, so the stripping stays as a read-side shim +// even now that nothing writes the sentinels any more. var stickyHistorySentinelPattern = regexp.MustCompile(`(?m)^\s*\s*$`) // tryDetailsExpand checks whether c is an HTML block opening a @@ -164,11 +164,11 @@ var stickyHistorySentinelPattern = regexp.MustCompile(`(?m)^\s*