WP-MarkDown icon indicating copy to clipboard operation
WP-MarkDown copied to clipboard

BUG: Markdown strips down the spaces or indents inside the pre/code tag

Open manojhl opened this issue 11 years ago • 4 comments

When I write code inside the shortcode tags wp-markdown strips out the spaces and even new lines in between them.

manojhl avatar May 08 '14 06:05 manojhl

Hi @manojhl - can you give me a test case? i.e. What you type in, what you expect, and what you actually get.

stephenharris avatar May 08 '14 09:05 stephenharris

@stephenharris sorry my mistake, the code was written inside a shorcode but markdownify don't consider this a code block so removed all indents inside it.... Is their any way around it, to notify not to strip off the indents inside a shortcode..filter!!!

manojhl avatar May 08 '14 10:05 manojhl

K I got it from the issue #38.. Thanks.. Closing it..

manojhl avatar May 08 '14 10:05 manojhl

@stephenharris this is not a shortcode issue it works fine with the default wp editor, markdown don't consider any code block inside short code. so removed all indents inside it. Sample

[tabx]
  <pre>
    <code class="language-css">
     * { 
       -webkit-box-sizing: border-box; 
           -moz-box-sizing: border-box; 
                    box-sizing: border-box; 
       }
    </code>
  </pre>
[/tabx]

I use this short code to display code and preview in tab-nav. The indents(spaces) are given to css properties for proper alignment and I have checked the database indents are removed..

It works fine outside the shortcode!!! :D

manojhl avatar May 08 '14 15:05 manojhl