Create a post with the problem API with HTML

The html code that I pass in the html parameter may have markup similar to the following:

<pre> <code class="language-py">
#!/usr/bin/env python
 import cgitb
 cgitb.enable()
 print("Content-Type: text/html;charset=utf-8")
 print"Content-type:text/html\r\n\r\n"
 print '<html>'
 print '<head>'
 print '<title> Hello Word </title>'
 print '</head>'
 print '<body>'
 print '<h2>Hello Word </h2>'
 print '</body>'
 print '</html>'
</code></pre>

<pre><code class="language-php">
<?php phpinfo(); ?>
</code></pre>

<IfModule mod_alias.c>
	<IfModule mod_cgi.c>
		Define ENABLE_USR_LIB_CGI_BIN
	</IfModule>
	<IfModule mod_cgid.c>
		Define ENABLE_USR_LIB_CGI_BIN
	</IfModule>
	<IfDefine ENABLE_USR_LIB_CGI_BIN>
		#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
		#<Directory "/usr/lib/cgi-bin">
		#	AllowOverride None
		#	Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		#	Require all granted
		#</Directory>
		## cgi-bin config
		ScriptAlias /cgi-bin/ /var/www/cgi-bin/
	    <Directory "/var/www/cgi-bin/">
	        AllowOverride None
	        Options +ExecCGI 
	    </Directory>
	</IfDefine>
</IfModule>

After creating the post, using the API, the result is the following:

 
#!/usr/bin/env python
 import cgitb
 cgitb.enable()
 print("Content-Type: text/html;charset=utf-8")
 print"Content-type:text/html\r\n\r\n"
 print ''
 print ''
 print ''
 print ''
 print ''
 print 'Hello Word '
 print ''
 print ''



 Define ENABLE_USR_LIB_CGI_BIN
 
 
 Define ENABLE_USR_LIB_CGI_BIN
 
 
 #ScriptAlias /cgi-bin//usr/lib/cgi-bin/#
 # AllowOverride None
 # Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
 # Require all granted
 #
 ## cgi-bin config
 ScriptAlias /cgi-bin//var/www/cgi-bin/
 AllowOverride None
 Options +ExecCGI

How can I solve this problem? Thank you

You’re mixing up HTML that you want the server to interpret as display HTML and HTML that you want to be content.The server can’t guess this, so it is interpreting all of your HTML.

You need to encode all HTML that should be content using HTML entities.

E.g.

print '<html>'

Should be

print '&lt;html&gt;'

i solved it by changing nodejs plugin, thanks