canvas-native
Advanced tools
Comparing version 2.4.2 to 2.4.3
@@ -48,3 +48,3 @@ 'use strict'; | ||
if (!prev || prev.type !== this.type) { | ||
if (!prev || prev.type !== this.type || prev.language !== this.language) { | ||
result = '```' + (this.language || '') + '\n' + result; | ||
@@ -51,0 +51,0 @@ } |
@@ -30,3 +30,5 @@ import Type from './type'; | ||
if (!prev || prev.type !== this.type) { | ||
if (!prev || | ||
((prev.type !== this.type) || | ||
(prev.language !== this.language))) { | ||
result = `\`\`\`${this.language || ''}\n${result}`; | ||
@@ -33,0 +35,0 @@ } |
{ | ||
"name": "canvas-native", | ||
"description": "Utilities for working with the native Canvas format", | ||
"version": "2.4.2", | ||
"version": "2.4.3", | ||
"author": "Jonathan Clem <jonathan@usecanvas.com>", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/usecanvas/canvas-native/issues", |
@@ -61,2 +61,8 @@ import Code from '../../../lib/types/code'; | ||
it('prepends a fence when preceded by a different lang', () => { | ||
const line2 = Code.match(wrap('code-ruby') + 'alert("ok");'); | ||
expect(line.toMarkdown(line2, line)) | ||
.to.eql('```\nalert("ok");'); | ||
}); | ||
it('prepends a fence at the beginning of a document', () => { | ||
@@ -63,0 +69,0 @@ expect(line.toMarkdown(null, line)) |
126875
3584