HTML to Markdown conversion issue

Originally asked by Harold Oconitrillo on 03 October 2023 (original question)


We have an Exalate integration between Exalate and JSM Cloud. A text field in Exalate sync to a text field in Jira.

When that text field contains a bullet list the line after the list is put in the last bullet too.

I added an example. White screenshot is from Azure Devops. Dark screenshot from Jira.

A debug.error shows me the following HTML coming from Azure Devops

<div>Hello, </div><div><br> </div><div><ul><li>ONE </li><li>TWO </li> </ul><div>Three</div>

This is our code:

issue.customFields.“Public Comment”.value = nodeHelper.toMarkDownFromHtml(replica.customFields.“Public Comment”.value)

Any chance the toMarkDownFromHtml function contains a bug?


Answer by Mathieu Lepoutre on 04 December 2023

Hi Harold

Checking the HTML

<div>Hello, </div>
<div>
  <br>
</div>
<div>
  <ul>
    <li>ONE </li>
    <li>TWO </li>
  </ul>
  <div>Three</div>"

It is missing a bullet point at the 3th row.

Your code for stripping HTML is correct.

Exalate is putting it to markdown.

Please check if the 3th row is also in bulletpoint.

Thank you.

Kind regards,
Mathieu Lepoutre