-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Describe the bug
Syntax highlighting incorrectly marks lines as deletions
Steps to reproduce
Given some terraform outputs that emit bullet point list items or CLI switches in their own lines (see snippets below), run terraform plan (e.g. on a PR), then observe the incorrect formatting. Terrateam treats leading dashes (-) as if terraform resources were being removed, highlighting them with red.
Expected behavior
No diffs on bullet point list items, no diffs on CLI switches.
Actual behavior
Observed diffs on bullet point list items, as part of terraform outputs:
Allowed DNS values (targets for your records):
- dns-garden-3.{redacted}.
- dns-garden-8.{redacted}.
- dns-garden-11.{redacted}.
[...]
Diffs on CLI switches, as part of terraform outputs:
[...]
2. To delete a DNS record:
curl -X DELETE https://{redacted}.execute-api.us-east-1.amazonaws.com/v1 \
-H "x-api-key: [YOUR_API_KEY]" \
-H "Content-Type: application/json" \
-d '{"dns_record": "example.{redacted}"}'
[...]
Terrateam incorrectly formats / colorizes it like this on github (screenshot 1), and also in the web app (screenshot 2) – this only happens with syntax highlighting enabled:
Terrateam version & environment details
The latest version as of the time of this issue
Additional context
Originally reported via Slack: https://terrateamio.slack.com/archives/C02GDJFTZ2Q/p1766285388781529?thread_ts=1764947614.375509&cid=C02GDJFTZ2Q