Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ianstormtaylor/slate
Browse files Browse the repository at this point in the history
  • Loading branch information
ianstormtaylor committed Jul 28, 2016
2 parents 4543319 + 84829f5 commit d80bda5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/transforms/fixtures/wrap-inline/twice/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

import assert from 'assert'

export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const text = texts.first()
const range = selection.merge({
anchorKey: text.key,
anchorOffset: 7,
focusKey: text.key,
focusOffset: 11
})

const next = state
.transform()
.moveTo(range)
.wrapInline('inner')
.wrapInline('outer')
.apply()

return next
}
7 changes: 7 additions & 0 deletions test/transforms/fixtures/wrap-inline/twice/input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: before word after
16 changes: 16 additions & 0 deletions test/transforms/fixtures/wrap-inline/twice/output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: "before "
- kind: inline
type: outer
nodes:
- kind: inline
type: inner
nodes:
- kind: text
text: word
- kind: text
text: " after"

0 comments on commit d80bda5

Please sign in to comment.