We are noticing some cases where our plans appear to skip over many plans because of invalid markdown.
As an example, we recently ran atlantis over a PR that affected ~150 modules. Here is the end of one comment:
### 85. dir: `infra/datadog/agent_container/env-prod` workspace: `default`
```diff
Validated that dmattia is an admin
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
Plan: 0 to add, 0 to change, 0 to destroy.
</details>
<br>
**Warning**: Output length greater than max comment size. Continued in next comment.
And then in the next comment it continues with:
Continued from previous comment.
<details><summary>Show Output</summary>
```diff
orward: To **apply** this plan, comment:
* `atlantis apply -d infra/datadog/agent_container/env-prod`
* :put_litter_in_its_place: To **delete** this plan click [here](https://atlantis.ci.transcend.io/lock?id=transcend-io%252Fmain%252Finfra%252Fdatadog%252Fagent_container%252Fenv-prod%252Fdefault)
* :repeat: To **plan** this project again, comment:
* `atlantis plan -d infra/datadog/agent_container/env-prod`
---
### 86. dir: `infra/datadog/agent_container/env-prod/secrets` workspace: `default`
```diff
Validated that dmattia is an admin
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
Plan: 0 to add, 0 to change, 0 to destroy.
This causes the plan to appear to jump forward and skip quite a number of outputs:

If I go to "edit" the comment in between the jump, I can see all of the missing job outputs
So this is as a result of our logic for splitting comments being naive and assuming that we're splitting in the middle of a plan/apply output. In your case we ended up splitting in the middle of the commands output and so when we apply
```diff
it borks all the markdown.
I think the true fix here is for the markdown renderer to return a struct that describes the output better rather than just a string. Then the splitting functionality can be smarter about where it splits long comments.
It seems we are facing the current issue as well.
I really like the elegant solution that @lkysow is suggesting here and i think this will straight solve the https://github.com/runatlantis/atlantis/issues/1021 as well.
What do you think?
I can also spend some time on this matter to make those problems go away 馃槃
Most helpful comment
So this is as a result of our logic for splitting comments being naive and assuming that we're splitting in the middle of a plan/apply output. In your case we ended up splitting in the middle of the commands output and so when we apply
it borks all the markdown.
I think the true fix here is for the markdown renderer to return a struct that describes the output better rather than just a string. Then the splitting functionality can be smarter about where it splits long comments.