Code block not returning HTML code
Status: Closed · Asked by PatFriedl on · 0 views
I'm using a JavaScript code block to do some HTML formatting of some text, but when I try to use the output, all HTML is stripped or missing from the output. I'm also seeing that any HTML in the code block is being rendered as HTML, so that may be a problem as well.
Is there a way to force the output to stay formatted with HTML tags in place?
Hey @PatFriedl
Can you please share the workflow in which you have tried the same so that we can look into it and help you accordingly?
Hey @PatFriedlCan you please share the workflow in which you have tried the same so that we can look into it and help you accordingly?
https://connect.pabbly.com/workflow/mapping/IjU3NjUwNTZlMDYzNzA0MzY1MjZhNTUzNDUxMzci_pc
Hey @PatFriedl
To integrate HTML content into a JavaScript Code action step, you might consider encapsulating the codes within JSON format. This approach helps in the seamless transfer and execution of the HTML content within the JavaScript environment, ensuring compatibility and smooth functionality within your workflow.
I'm not sure how that helps with future steps where I need to insert the converted markdown into email. Can you give me an example? And is there a reason why the textbox for code formats/processes HTML so it breaks the code?
Hey @PatFriedl
Can you please share the JS code you are trying to execute with us once so that we can look into it?
Here's the code:
function convertMarkdownToHTML(markdown) {
let htmlContent = markdown.replaceAll(';
htmlContent = htmlContent.replaceAll('**','');
htmlContent = htmlContent.replaceAll('\n','
');
return htmlContent;
}
var rssContent = 'markdown content here';
var output = convertMarkdownToHTML(rssContent);
return output;
It manages to convert the "\n" and strip the "**" markdown, but fails on the image tag replacement for some reason. Then any time you open the code block after saving, Pabbly formats the code as HTML, so the
and image tag HTML break the code.
Attachments

I gave up - the code block can't do this basic task, so I wrote it in PHP and hosted it on my server
Thanks for the update and let us know if you need any further help.
Any solution for this?
Any solution for this?
Can you please share your complete use case once in detail, so that we can check on it and guide you accordingly?
The problem is that I want HTML output by Code by Pabbly but this module only output plain text
We have replied to your query on your other thread, please check that out.