This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Also accept text.md as a valid Markdown scope#177
Merged
daviwil merged 1 commit intoatom:masterfrom Sep 6, 2018
Merged
Conversation
Contributor
|
Thanks a lot @burodepeper! |
1 task
burodepeper
added a commit
to burodepeper/whitespace
that referenced
this pull request
Dec 19, 2018
I made a mistake in atom#177. For whatever reason, I wrote a quick patch in my browser, and obviously, this code would never yield anything useful, _because it is just silly javascript_. The discussion in atom#185 made me verify my patch. This new patch should actually do something, while I have to admit that I've only verified it via Chrome's console. My test below seems valid enough. ```js const markdownGrammars = ['source.gfm', 'text.md'] let grammarScopeName = 'text.md' markdownGrammars.includes(grammarScopeName) // true grammarScopeName = 'source.js' markdownGrammars.includes(grammarScopeName) // false ```
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
Description of the Change
Appended an if statement to allow for either source.gfm or text.md to be valid scope names for Markdown files.
Alternate Designs
Ideally, there'd be some standard to detect whether content is Markdown without relying on a scope name, which is a little overkill for this feature. I think the proposed change is acceptable.
Benefits
language-gfm isn't the only Markdown grammar. This patch helps serve a larger audience.
Possible Drawbacks
None?
Applicable Issues
Keep Markdown Line Break Whitespaceoption burodepeper/language-markdown#200