We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
deleteEveryBlock
1 parent a42fa3c commit 96abeffCopy full SHA for 96abeff
2 files changed
src/text.ts
@@ -225,6 +225,7 @@ export class Text {
225
}
226
} else if (matches > 0) {
227
if (line.match(patterns[0])) {
228
+ matchRow = index;
229
matches = 1;
230
} else {
231
matches = 0;
tests/text.spec.ts
@@ -279,6 +279,12 @@ describe('Text', () => {
279
text.deleteEveryBlock(['one', 'one']);
280
expect(text.content).to.equal('one\ntwo');
281
});
282
+
283
+ it('should correctly handle repeated first line of block (issue #1)', () => {
284
+ const text = new Text('one\ntwo\nthree\n');
285
+ text.deleteEveryBlock(['', 'three']);
286
+ expect(text.content).to.equal('one\n');
287
+ });
288
289
290
describe('append', () => {
0 commit comments