We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ede7180 commit 5e48bd5Copy full SHA for 5e48bd5
1 file changed
test/test.js
@@ -101,6 +101,20 @@ describe('quote-selection', function () {
101
102
assert.equal(textarea.value, 'Has text\n\n> bold\n\n')
103
})
104
+
105
+ it('allows processing the quoted text before inserting it', function () {
106
+ const el = document.querySelector('#quotable')
107
+ const selection = window.getSelection()
108
+ window.getSelection = () => createSelection(selection, el)
109
110
+ const textarea = document.querySelector('#not-hidden-textarea')
111
+ const quote = new Quote()
112
+ quote.processSelectionTextFn = text => text.replace('Quotable', 'replaced')
113
114
+ quote.insert(textarea)
115
116
+ assert.equal(textarea.value, 'Has text\n\n> Test replaced text, bold.\n\n')
117
+ })
118
119
120
describe('with markdown enabled', function () {
0 commit comments