What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

Often, I embed code snippets from other sites as actual block quotes (together with their explanation).

Expected result

Let's take this absolutely nonsense example. I want to see this output:

If you want to append a file to another, and do other stuff, use cat:

 cat one_file > other_file; with a really long command after that; blah yada foo;

Actual result

However, if you format these lines using regular Markdown (e.g. copy and paste, indent using the "code" button), and then press the "blockquote" button, what you get is:

If you want to append a file to another, and do other stuff, use cat:

cat one_file > other_file; with a really long command after that;

blah yada foo;

… thus breaking the long line of code. Here's the actual wrong Markdown source:

>     cat one_file > other_file; with a really long command after that;
> blah yada foo;

This is somewhat tedious to fix, as it involves checking every line manually, removing the >, et cetera.

How to fix?

When converting to a block quote, WMD should check that long lines formatted as code are not wrapped automatically. The auto-wrapping works for regular text, but pre-formatted text should of course not be wrapped.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

The editor does take this scenario into account, but the mechanism that does so is currently broken (it'll only not wrap if the line starts with "undefined", which isn't particularly useful).

The wrap() method should be using commandProto.prefixes in place of this.prefixes when testing for special cases. Making that change will allow the test to pass and handle the inner block Markdown case appropriately, in the way you expected.

share|improve this answer
    
Nice find, that should be fixed very easily then. –  slhck Oct 1 '11 at 22:27
    
I have nothing to add to this. Thanks! code.google.com/p/pagedown/source/… –  balpha Oct 7 '11 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .