diff --git a/spec/fixtures/markdown/file.markdown b/spec/fixtures/markdown/file.markdown index 0eec6a120..964679b09 100644 --- a/spec/fixtures/markdown/file.markdown +++ b/spec/fixtures/markdown/file.markdown @@ -1,3 +1,20 @@ ## File.markdown -:cool: \ No newline at end of file +:cool: + +```ruby +def func + x = 1 +end +``` + +``` +function f(x) { + return x++; +} +``` + +```kombucha +drink-that-stuff: + tastes-weird~ +``` diff --git a/src/packages/markdown-preview/spec/markdown-preview-view-spec.coffee b/src/packages/markdown-preview/spec/markdown-preview-view-spec.coffee index c0f133502..5459ad681 100644 --- a/src/packages/markdown-preview/spec/markdown-preview-view-spec.coffee +++ b/src/packages/markdown-preview/spec/markdown-preview-view-spec.coffee @@ -31,3 +31,13 @@ describe "MarkdownPreviewView", -> it "reassociates with the same buffer when deserialized", -> newPreview = deserialize(preview.serialize()) expect(newPreview.buffer).toBe buffer + + fdescribe "code block tokenization", -> + describe "when the code block's fence name has a matching grammar", -> + it "tokenizes the code block with the grammar", -> + expect(preview.find("pre code.lang-ruby .entity.name.function.ruby")).toExist() + + describe "when the code block's fence name doesn't have a matching grammar", -> + it "does not tokenize the code block", -> + expect(preview.find("pre code:not([class])").children().length).toBe 0 + expect(preview.find("pre code.lang-kombucha").children().length).toBe 0