title: Wordpress / Shortcodes : html markup removed by Wordpress
body: <p>For some reason, Wordpress removes most of the HTML markup from shortcode output while I need to use HTML markup inside those shortcodes.</p>
  
  <p>There are a couple of suggestions on Stackoverflow but none of them worked for me. Let's take an example.</p>
  
  <p>I call my shortcode in WP with a simple [myshortcode id="1"]</p>
  
  <p>In my PHP, I use this:</p>
  
  <pre><code>function myshortcode($atts)
  {
     ob_start();
     ?&gt;
     &lt;ul&gt;&lt;li&gt;test&lt;/li&gt;&lt;li&gt;test2&lt;/li&gt;&lt;/ul&gt;
     &lt;?PHP
     return ob_get_clean();
  }
  add_shortcode( 'myshortcode', 'myshortcode' );
  </code></pre>
  
  <p>The output I get is: test1test2 without the HTML markup</p>
  
  <p>If I use links (www), they are preserved but div, span, ul, li, ... are systematically removed.</p>
  
  <p>I have tried to add the markup in the end with the return statement but it doesn't work. I have tried what is suggested here <a href="https://codex.wordpress.org/Shortcode_API#Output" rel="nofollow noreferrer">https://codex.wordpress.org/Shortcode_API#Output</a> but it doesn't work.</p>
  
  <p>Do you have any idea?</p>
  
  <p>Thanks!</p>
  
  <p>Laurent</p>