-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GFM hard line breaks don't follow spec #1380
Comments
Relevant GFM spec: |
Yes this appears to be a bug. function testOptions(opts) {
var md632 = 'foo \nbaz';
var md633 = 'foo\\\nbaz';
var md647 = 'foo\nbaz';
var md648 = 'foo \n baz';
console.log(opts);
console.log(marked(md632, opts));
console.log(marked(md633, opts));
console.log(marked(md647, opts));
console.log(marked(md648, opts));
console.log('\n');
}
testOptions({gfm: true, breaks: true});
testOptions({gfm: true, breaks: false}); @joshbruce Any idea why gfm.0.2.8.json is missing these tests? How did you acquire this file? |
testing |
The "breaks" option was added to make the "gfm" option function like github (i.e. add With the "breaks" option off it will follow the spec. |
@styfle gfm.0.28.json only has tests for things that are different between GFM 0.28 and CommonMark 0.28 The hard and soft line breaks are the same in both specs (even though github doesn't follow them) |
Looks like the real problem is that our documentation for the "breaks" option is wrong. |
Agree with @UziTech. |
according to the Common Mark spec tests 100% pass. And just testing manually 100% pass with marked/test/specs/commonmark/commonmark-spec.js Lines 53 to 54 in 97be813
|
Describe the bug
GFM spec describes the following as a hard line break:
and should translate to the following HTML
Similarly, the following is a soft line break (note the lack of 2 trailing spaces):
and should translate to the following HTML
This spec should be followed when
gfm
andbreaks
are both enabled, however enablingbreaks
will always output the first style (hard line breaks), even when the trailing spaces are omitted.To Reproduce
RunKit example
Expected behavior
When
gfm
andbreaks
are enabled, the second example (soft line break) should not output a<br />
tag.should output
The text was updated successfully, but these errors were encountered: