mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-21 13:51:59 +02:00
Add benchmark for Node.getTexts
This commit is contained in:
parent
95cfc2f972
commit
b54ddf10ce
perf/benchmarks/get-texts-normal
6
perf/benchmarks/get-texts-normal/index.js
Normal file
6
perf/benchmarks/get-texts-normal/index.js
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
module.exports = {
|
||||
run(state) {
|
||||
state.document.getTexts()
|
||||
}
|
||||
}
|
40
perf/benchmarks/get-texts-normal/input.yaml
Normal file
40
perf/benchmarks/get-texts-normal/input.yaml
Normal file
@ -0,0 +1,40 @@
|
||||
nodes:
|
||||
- kind: block
|
||||
type: paragraph
|
||||
nodes:
|
||||
- kind: text
|
||||
ranges:
|
||||
- text: 'This is editable '
|
||||
- text: 'rich'
|
||||
marks:
|
||||
- type: bold
|
||||
- text: ' text, '
|
||||
- text: 'much'
|
||||
marks:
|
||||
- type: italic
|
||||
- text: ' better than a '
|
||||
- text: '<textarea>'
|
||||
marks:
|
||||
- type: code
|
||||
- text: '!'
|
||||
- kind: block
|
||||
type: paragraph
|
||||
nodes:
|
||||
- kind: text
|
||||
ranges:
|
||||
- text: 'Since it''s rich text, you can do things like turn a selection of text '
|
||||
- text: 'bold'
|
||||
marks:
|
||||
- type: bold
|
||||
- text: ', or add a semantically rendered block quote in the middle of the page,
|
||||
like this:'
|
||||
- kind: block
|
||||
type: block-quote
|
||||
nodes:
|
||||
- kind: text
|
||||
text: 'A wise quote.'
|
||||
- kind: block
|
||||
type: paragraph
|
||||
nodes:
|
||||
- kind: text
|
||||
text: 'Try it out for yourself!'
|
Loading…
x
Reference in New Issue
Block a user