Skip to content

Commit

Permalink
Fix lists
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
daguej committed Jun 19, 2015
1 parent 1ceca24 commit 4715e77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var format = exports.format = {
};

function convert(ops) {
var $ = cheerio.load(''), group, line, el, activeInline;
var $ = cheerio.load(''), group, line, el, activeInline, beginningOfLine;

function newLine() {
el = line = $('<p>');
Expand Down Expand Up @@ -117,11 +117,11 @@ function convert(ops) {
}
}
}
beginningOfLine = true;

} else {

for (var j = 0; j < lines.length; j++) {
if (j > 0 && group && ++group.distance >= 2) {
if ((j > 0 || beginningOfLine) && group && ++group.distance >= 2) {
group = null;
}
applyStyles(op.attributes, ops[i+1] && ops[i+1].attributes);
Expand All @@ -130,6 +130,7 @@ function convert(ops) {
newLine();
}
}
beginningOfLine = false;

}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quill-render",
"version": "1.0.1",
"version": "1.0.2",
"description": "Renders quilljs deltas into HTML",
"main": "index.js",
"dependencies": {
Expand Down

0 comments on commit 4715e77

Please sign in to comment.