canvas-native
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -80,7 +80,5 @@ 'use strict'; | ||
if (line.type === 'title') { | ||
context.hasTitle = true; | ||
} | ||
result.push(line); | ||
result.push(line); | ||
context.hasTitle = true; // Only the first line is eligible | ||
} | ||
@@ -87,0 +85,0 @@ } catch (err) { |
@@ -41,7 +41,5 @@ import PARSE_ORDER from './parse-order'; | ||
if (line.type === 'title') { | ||
context.hasTitle = true; | ||
} | ||
result.push(line); | ||
result.push(line); | ||
context.hasTitle = true; // Only the first line is eligible | ||
} | ||
@@ -48,0 +46,0 @@ |
{ | ||
"name": "canvas-native", | ||
"description": "Utilities for working with the native Canvas format", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"author": "Jonathan Clem <jonathan@usecanvas.com>", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/usecanvas/canvas-native/issues", |
@@ -33,4 +33,2 @@ import parse from '../../../lib/parsers/markdown'; | ||
console.log(parsed.map(p => p.source)); | ||
expect(parsed.map(n => n.source)).to.eql([ | ||
@@ -53,2 +51,10 @@ `${wrap('doc-heading')}Title`, | ||
}); | ||
it('only allows the first line to be a title', () => { | ||
const markdown = '\n# Foo'; | ||
expect(parse(markdown).map(n => n.source)).to.eql([ | ||
'', | ||
'# Foo' | ||
]); | ||
}); | ||
}); |
102191
2813