5

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.

0

1 Answer 1

6

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.

2

You must log in to answer this question.

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