Skip to content

Conversation

@Hipska
Copy link
Collaborator

@Hipska Hipska commented May 2, 2025

Base information

Question Answer
Related to a SourceForge thead / Another PR / Combodo ticket? N/A
Type of change? Bug fix

Symptom

The CKEditor in iTop 3.2 doesn't add newlines anymore after headers and paragraphs in the underlaying HTML code.

Reproduction procedure

  1. On iTop 3.2.1
  2. Make sure there is a Slack notification for a new public log entry
  3. Add a new public comment on a ticket. Make sure to include multiple paragraphs and/or headers.
  4. Observe the notification on Slack being malformed due to no newlines in the markdown text.

Cause

The updated CKE does not include newlines between html tags anymore.

- <p>Paragraph 1</p>
- <p>Paragraph 2</p>
+ <p>Paragraph 1</p><p>Paragraph 2</p>

This results in the following message markdown on Slack:

Paragraph 1Paragraph 2

Proposed solution

Add newline (\n) after paragraphs (p), headers (h1, h2, h3), list items (li) and code blocks.

Similar to what has been done in 7150630 for MS Teams.

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested all changes I made on an iTop instance
  • Would a unit test be relevant and have I added it?
  • Is the PR clear and detailed enough so anyone can understand digging in the code?

@jf-cbd
Copy link
Member

jf-cbd commented May 15, 2025

Hey, it looks all good to me, thanks for the PR 😊

@jf-cbd jf-cbd changed the title fix(ActionSlackNotification): Improve TransformHTMLToSlackMarkup with… N°8402 - fix(ActionSlackNotification): Improve TransformHTMLToSlackMarkup with… May 16, 2025
jf-cbd and others added 3 commits May 16, 2025 15:22
Add test case to avoid future potential regressions on different tags (and also prevent the new line issue)
@jf-cbd jf-cbd merged commit bff244d into Combodo:master May 19, 2025
@github-project-automation github-project-automation bot moved this from First review needed to Finished in Combodo PRs dashboard May 19, 2025
@jf-cbd
Copy link
Member

jf-cbd commented May 19, 2025

Merged, thanks for your bug fix suggestion😊

@Hipska Hipska deleted the fix/slack_html branch May 19, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants