Skip to content

Conversation

@Yukaii
Copy link
Member

@Yukaii Yukaii commented Oct 20, 2019

resolves #1212

Changes

This PR introduce a new configuration entry let you follow CommonMark spec break behavior:

Set config.defaultUseHardbreak to true
(Current CodiMD implementation)
Set config.defaultUseHardbreak to false
(CommonMark)
Screen Shot 2019-10-20 at 2 22 00 PM Screen Shot 2019-10-20 at 2 22 39 PM

Notice that we keep the default defaultUseHardbreak value to true for preserving the current behavior.

TODOs

  • Update documentation

Ref

@Yukaii Yukaii temporarily deployed to codimd-app-pr-1306 October 20, 2019 06:30 Inactive
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
When `RevealMarkdown.initialize` is called, it use `md.render` to render markdown, but no until we parse meta, the md.options.breaks would be default value we set in extra.js.

So this commit move forward the whole meta parsing block. Ensure line break setting changed before `md.render` get called.

Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
@Yukaii Yukaii force-pushed the feature/configurable-break-style branch from 8db1d04 to 56b669a Compare October 20, 2019 06:31
@Yukaii Yukaii temporarily deployed to codimd-app-pr-1306 October 20, 2019 06:31 Inactive
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
@jackycute
Copy link
Member

LGTM, thanks @Yukaii

@Yukaii Yukaii added this to the 1.4.0 Release milestone Oct 20, 2019
@Yukaii Yukaii temporarily deployed to codimd-feature-configur-zkwdjb November 1, 2019 02:29 Inactive
@Yukaii Yukaii merged commit aa5a50f into develop Nov 1, 2019
@Yukaii Yukaii deleted the feature/configurable-break-style branch November 1, 2019 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't insert <br/> within paragraphs, unless the line ends with at least two spaces

3 participants