Skip to content

Commit

Permalink
use original title if slugified title is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe-noh committed May 3, 2017
1 parent 0341db4 commit 32f2f7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/md-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class MdRenderer {
}

saveHeading(title: string, parent:MarkdownHeading = {id:null, children: this.headings}) :MarkdownHeading {
let slug = slugify(title);
let slug = slugify(title) || title;
let id = slug;
if (parent && parent.id) id = `${parent.id}/${id}`;
parent.children = parent.children || {};
Expand Down

0 comments on commit 32f2f7f

Please sign in to comment.