Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue#63: make dependency markit upgrade to 0.2.0 and fixed post title parsing problem #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/sdk/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ exports.parse = parseContent;

function parseMeta(content) {
var html = md.markdown(content);
var m = html.match(/<h1>(.*?)<\/h1>/);
var m = html.match(/<h1 id=".*?">(.*?)<\/h1>/);
var meta = {};
if (!m) {
meta.title = null;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"colorful": "~2.1.0",
"highlight.js": "~7.5.0",
"markit": "~0.1.0",
"markit": "~0.2.0",
"swig": "~0.14.0",
"underscore": "~1.5.2",
"rimraf": "~2.2.2",
Expand Down
2 changes: 1 addition & 1 deletion tests/sdk.file.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('file', function() {
});
it('can list files', function() {
var datafiles = file.list(__dirname + '/data');
datafiles.should.include(__dirname + '/data/year/2012-1.md');
datafiles.should.containEql(__dirname + '/data/year/2012-1.md');
});
it('can read json', function() {
var data = file.readJSON(__dirname + '/../package.json');
Expand Down
6 changes: 3 additions & 3 deletions tests/sdk.filters.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ var filters = require('..').sdk.filters;
describe('filters', function() {
it('can render markdown', function() {
var markdown = filters.filters.markdown;
markdown('# header').should.include('header</h1>');
markdown('# header').should.containEql('header</h1>');
});
it('can render xmldatetime', function() {
var xmldatetime = filters.filters.xmldatetime;
xmldatetime('2012-12-25').should.include('2012-12-25T00:00:00');
xmldatetime('2012-12-25').should.containEql('2012-12-25T00:00:00');

var d = new Date();
xmldatetime(d).should.equal(d.toISOString());
Expand Down Expand Up @@ -132,6 +132,6 @@ describe('highlight', function() {
it('can highlight code', function() {
var code = 'var foo = "bar";';
var func = filters.filters.highlight;
func(code, 'js').should.include('highlight');
func(code, 'js').should.containEql('highlight');
});
});
2 changes: 1 addition & 1 deletion tests/sdk.highlight.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ describe('highlight.render', function() {
});

it('should render highlight code', function() {
hl.render('var a', 'js').should.include('highlight');
hl.render('var a', 'js').should.containEql('highlight');
});
});
4 changes: 2 additions & 2 deletions tests/sdk.markdown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ var text = [

describe('markdown.render', function() {
it('should have injected code', function() {
md.render(text).should.include('nico-insert-code');
md.render(text).should.containEql('nico-insert-code');
});
it('should have iframe code', function() {
md.render(text).should.include('allowtransparency');
md.render(text).should.containEql('allowtransparency');
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/sdk.post.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('post', function() {

it('has toc', function() {
var data = post.read(__dirname + '/data/unicode-post.md');
data.toc.should.include('<ul>');
data.toc.should.containEql('<ul>');
});

it('can load posts', function() {
Expand Down