Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit e57c238

Browse files
committed
Change strikethrough to ~text~
1 parent 39d265b commit e57c238

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export const CODE_BLOCK_REGEX = /^```([\w-]+)?\s*$/;
55
export const inlineMatchers = {
66
BOLD: [/\*(.+)\*$/g],
77
ITALIC: [/_(.+)_$/g],
8-
CODE: [/`(.+)`$/g],
9-
STRIKETHROUGH: [/~~(.+)~~$/g],
8+
CODE: [/`([^`]+)`$/g],
9+
STRIKETHROUGH: [/~(.+)~$/g],
1010
};
1111

1212
export const CODE_BLOCK_TYPE = "code-block";

src/modifiers/__test__/handleInlineStyle-test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe("handleInlineStyle", () => {
5454
blocks: [
5555
{
5656
key: "item1",
57-
text: "`h~~el*lo _inline~~_* style",
57+
text: "`h~el*lo _inline~_* style",
5858
type: "unstyled",
5959
depth: 0,
6060
inlineStyleRanges: [],
@@ -100,9 +100,9 @@ describe("handleInlineStyle", () => {
100100
},
101101
selection: new SelectionState({
102102
anchorKey: "item1",
103-
anchorOffset: 21,
103+
anchorOffset: 19,
104104
focusKey: "item1",
105-
focusOffset: 21,
105+
focusOffset: 19,
106106
isBackward: false,
107107
hasFocus: true,
108108
}),
@@ -351,7 +351,7 @@ describe("handleInlineStyle", () => {
351351
blocks: [
352352
{
353353
key: "item1",
354-
text: "hello ~~inline~ style",
354+
text: "hello ~inline style",
355355
type: "unstyled",
356356
depth: 0,
357357
inlineStyleRanges: [],
@@ -382,9 +382,9 @@ describe("handleInlineStyle", () => {
382382
},
383383
selection: new SelectionState({
384384
anchorKey: "item1",
385-
anchorOffset: 15,
385+
anchorOffset: 13,
386386
focusKey: "item1",
387-
focusOffset: 15,
387+
focusOffset: 13,
388388
isBackward: false,
389389
hasFocus: true,
390390
}),

0 commit comments

Comments
 (0)