scribe-editor
Advanced tools
Comparing version 0.1.10 to 0.1.11
@@ -20,10 +20,10 @@ ## List of `contenteditable` Browser Inconsistencies | ||
whereas Firefox will not: http://jsbin.com/olEbecEM/1/edit?js,output | ||
- Given content of "<p>1|</p>", when inserting HTML of "<p>2</p>", Chrome will | ||
- Given content of `<p>1|</p>`, when inserting HTML of `<p>2</p>`, Chrome will | ||
merge the inserted P element into the existing P element, whereas Firefox | ||
will not: http://jsbin.com/uvEdacoz/6/edit?js,output | ||
- Given content of "<p>1|</p>", when inserting HTML of "<p>2<o></o></p>", | ||
- Given content of `<p>1|</p>`, when inserting HTML of `<p>2<o></o></p>`, | ||
Chrome will merge the inserted P element into the existing P element | ||
*excluding any custom elements*, whereas Firefox will not: | ||
http://jsbin.com/tuleq/3/edit?js,output | ||
- Given content of "<p>1<br>|</p>", when inserting HTML of "2<p>3</p>", Chrome | ||
- Given content of `<p>1<br>|</p>`, when inserting HTML of `2<p>3</p>`, Chrome | ||
will append the inserted unwrapped text node immediately into the existing | ||
@@ -58,2 +58,5 @@ paragraph, whereas Firefox will append a BR element followed by the text | ||
http://jsbin.com/yiyaq/1/edit?js,output | ||
* "`createLink`" | ||
- Firefox does not create A if selection is empty: | ||
http://jsbin.com/tutufi/2/edit?js,output | ||
* "`delete`": | ||
@@ -60,0 +63,0 @@ - Given a selection across multiple P elements, Firefox will place the caret |
@@ -0,1 +1,5 @@ | ||
# 0.1.11 | ||
* Fix [`createLink` browser inconsistency](https://github.com/guardian/scribe/commit/4c8b536b3f029e51f54de43a6df9ce07bcf63f3e) ([#190](https://github.com/guardian/scribe/pull/190)) | ||
* Bug: Correct object reference ([517b22ab](https://github.com/guardian/scribe/commit/517b22ab88e5dfc231b10497e492a877e6a05668)) | ||
# 0.1.10 | ||
@@ -2,0 +6,0 @@ * Fix redo ([da9c3844](https://github.com/guardian/scribe/commit/da9c3844fc047bc3c0bce559a013ec7fdecfc0b1) [#133](https://github.com/guardian/scribe/pull/133)) |
{ | ||
"name": "scribe-editor", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"main": "src/scribe.js", | ||
@@ -14,2 +14,3 @@ "dependencies": { | ||
"mocha": "~1.18.2", | ||
"mversion": "~0.4.3", | ||
"plumber-cli": "~0.3.0", | ||
@@ -16,0 +17,0 @@ "plumber": "~0.3.0", |
@@ -15,3 +15,3 @@ Scribe [](https://travis-ci.org/guardian/scribe) | ||
of its kind. For now, you can join us on IRC at | ||
[#scribejs](irc://irc.freenode.net:6697/#scribejs). | ||
[#scribejs] on freenode. | ||
@@ -75,2 +75,5 @@ [See an example][example]. | ||
Also be sure to check the [`examples`](./examples) directory for an | ||
AMD syntax example as well as a CommonJS (browserify) example. | ||
## Architecture | ||
@@ -77,0 +80,0 @@ |
@@ -42,3 +42,3 @@ define(function () { | ||
if (!this.isCollapsed) { | ||
if (! this.selection.isCollapsed) { | ||
// Start marker | ||
@@ -45,0 +45,0 @@ var rangeStart = this.range.cloneRange(); |
@@ -7,2 +7,3 @@ define([ | ||
'./patches/commands/outdent', | ||
'./patches/commands/create-link', | ||
'./patches/events' | ||
@@ -15,2 +16,3 @@ ], function ( | ||
outdentCommand, | ||
createLinkCommand, | ||
events | ||
@@ -33,3 +35,4 @@ ) { | ||
insertList: insertListCommands, | ||
outdent: outdentCommand | ||
outdent: outdentCommand, | ||
createLink: createLinkCommand, | ||
}, | ||
@@ -36,0 +39,0 @@ events: events |
@@ -98,2 +98,3 @@ define([ | ||
this.use(patches.commands.outdent()); | ||
this.use(patches.commands.createLink()); | ||
this.use(patches.events()); | ||
@@ -100,0 +101,0 @@ |
@@ -403,2 +403,33 @@ var chai = require('chai'); | ||
}); | ||
describe('createLink', function () { | ||
given('an empty editor', function () { | ||
when('the command is executed', function () { | ||
beforeEach(function () { | ||
scribeNode.click(); | ||
executeCommand('createLink', '#'); | ||
}); | ||
it('should insert A with specified URL and content', function () { | ||
return scribeNode.getInnerHTML().then(function (innerHTML) { | ||
expect(innerHTML).to.have.html('<p><a href="#">#</a><bogus-br></p>'); | ||
}); | ||
}); | ||
}); | ||
}); | ||
givenContentOf('<p>|1|</p>', function () { | ||
when('the command is executed', function () { | ||
beforeEach(function () { | ||
executeCommand('createLink', '#'); | ||
}); | ||
it('should wrap selection with A', function () { | ||
return scribeNode.getInnerHTML().then(function (innerHTML) { | ||
expect(innerHTML).to.have.html('<p><a href="#">1</a></p>'); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
65
3289
184
154008
17