This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from atom/ld-markdown-line-break
Move special Markdown line break whitespace handling to configuration
- Loading branch information
Showing
3 changed files
with
98 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,9 +56,9 @@ class Whitespace | |
[whitespace] = match | ||
return if ignoreWhitespaceOnlyLines and whitespace is lineText | ||
|
||
if grammarScopeName is 'source.gfm' | ||
# GitHub Flavored Markdown permits two spaces at the end of a line | ||
replace('') unless whitespace is ' ' and whitespace isnt lineText | ||
if grammarScopeName is 'source.gfm' and atom.config.get('whitespace.keepMarkdownLineBreakWhitespace') | ||
# GitHub Flavored Markdown permits two or more spaces at the end of a line | ||
replace('') unless whitespace.length >= 2 and whitespace isnt lineText | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lee-dohm
Author
Contributor
|
||
else | ||
replace('') | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why was this changed to
>= 2
?AFAIK, Markdown only needs 2 spaces to trigger a line break, and this change is allowing lines ending in obviously incorrect amounts of whitespace (10/+ spaces) to go uncleaned... And that is rather annoying when working with Markdown files created from PDF conversion (which can have horrible formatting), so if this change isn't necessary, it'd be nice to revert it.