Display code With line break in WordPress (HTML side)

Gregoire's Avatar

Gregoire

02 Nov, 2012 12:39 PM

Hi
First, thanks a lot for you app. I use all the time.
In Marked preference I checked "Retain line breaks in paragraph" and "Convert fenced code blocks"
For code (PHP, HTML or CSS), I writte between ~~~
When I use Marked to display the md file, the code just show off perfectly. But when I copy/paste the HTML (rendering by Marked) in WordPress (HTML side) article, I loose all the line break and tab.
Any idea?
Thanks
Grégoire

  1. 1 Posted by Gregoire on 02 Nov, 2012 12:56 PM

    Gregoire's Avatar

    I stop using ~~~ and put <pre> instead and use Byword to generate the HTML and it works perfectly.
    Brett, do you think that I can use Marked to have the same result.
    Thanks

  2. Support Staff 2 Posted by Brett on 02 Nov, 2012 01:14 PM

    Brett's Avatar

    Standard Markdown syntax for code blocks is to indent the whole block
    5 spaces. If you do that, it will display properly and you'll get pre
    tags generated automatically.

  3. 3 Posted by Gregoire on 02 Nov, 2012 01:23 PM

    Gregoire's Avatar

    Thanks Brett. It works now.
    Strange for Byword. This soft don't need that.
    It take more time to add the code block and space.

  4. 4 Posted by Gregoire on 02 Nov, 2012 01:45 PM

    Gregoire's Avatar

    I made many test (with html, css, php). The easiest way is to use <pre> with Byword to export in HTML. All the line break and tab are respected.

  5. Support Staff 5 Posted by Brett on 02 Nov, 2012 02:09 PM

    Brett's Avatar

    In Byword, just select the block and type ctrl-command-right arrow and it will indent. It will have the same effect in both Byword and Marked.

  6. Gregoire closed this discussion on 02 Nov, 2012 02:10 PM.

  7. Gregoire re-opened this discussion on 02 Nov, 2012 02:10 PM

  8. 6 Posted by Gregoire on 02 Nov, 2012 02:16 PM

    Gregoire's Avatar

    thanks for the trick Brett. After many test. You're right, that's the easiest method with Byword. And after, it works perfectly in Marked.

  9. Gregoire closed this discussion on 02 Nov, 2012 03:47 PM.

  10. Gregoire re-opened this discussion on 03 Nov, 2012 06:16 PM

  11. Gregoire closed this discussion on 03 Nov, 2012 06:19 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac