Question

Unable to convert markdown lists to emphasis HTML tags using Text Formatter.

  • 4 August 2023
  • 3 replies
  • 92 views

I am trying to use the Zapier formatter to format Markdown as HTML.  It properly makes the first bulleted list an unordered list using <li> tags, but then makes the rest of the lists into <em> which is an emphasis tag.  I do not see any spacing issues and I have validated the markdown in multiple tools and it is valid and renders correctly.

I can correct the issue by making sure that the first line before each list of bullets is a ###.  So for example, if I cut the “This breaks out like this per client:” out of the snip below, they will render as list items.  As I understand it, my markdown is valid either way.  

 

Markdown sample:

This is a  status report for Jul 28 – Aug 4, 2023.

###  Summary In the last week, we had 15 things.

* Marked as good: 14

* bad: 1

### Agent Summary As of today, we have 3 clients doing things

This breaks out like this per client:

* Client A: 19

* Client B: 25

* Client C: 97

 

Output:

<p>This is a  status report for Jul 28 – Aug 4, 2023</p>

<h3>Summary In the last week, we had 15 things.</h3>

<ul> <li>Marked as good: 14</li>

<li>bad: 1</li> </ul>

<h3>Agent Summary</h3>

This breaks out like this per client:

<em> Client A: 19

</em> Client B: 25

<em> Client C: 97

 


3 replies

Userlevel 7
Badge +14

Hi @axlf 

Good question.

Another option to try is to Ask AI.

  1. OpenAI
  2. ChatGPT
  • I have asked the AI overlords.  They like my markdown syntax and are not aware of any issues.
  • I can setup a chatGTP / OpenAI integration and ask it to format it, and it will with some consistency problems.

I am just looking to understand how the Zapier function should work before I throw it away and start using laser weapons or my own javascript code blocks to handle it. I am guessing that there is some assumption on formatting in the Zapier function that I am missing.

Userlevel 7
Badge +11

Hi there @axlf! 👋

I just did some testing in a Zap and it looks like it’s a glitch that occurs for lines where no markdown formatting has been selected. For cases like the “This breaks out like this per client:” text that don’t have any markdown formatting applied you’d need to ensure that there’s a double newline break or double paragraph break at the end of it.

So between the “This breaks out like this per client:” and the first list item (“* Client A: 19”)  in order for them to be output correctly as a list items. If there’s only a singular line break/paragraph break then it will wrap the subsequent lines in <em> tags. But if the line were to have a markdown formatting (like ### for a heading) applied then the subsequent text would be correctly converted into list items.

To my mind, this appears to be a bug with the Convert Markdown to HTML Formatter transform. I checked internally but couldn’t find any reports of this behaviour so I’d recommend reaching out to our Support team about this. They’ll be able to open up a bug report for this on your behalf so it can be investigated further. 

Can you try adding a double newline/paragraph breaks where applicable to the text that’s given to the Formatter action to see if that fixes it in the meantime?

Reply