-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(message-parser): Made changes in grammar.pegjs for the strikedown…
… approach (#1256) Co-authored-by: Hugo Costa <hugocarreiracosta@gmail.com>
- Loading branch information
1 parent
769e5ea
commit 7fdfdb1
Showing
4 changed files
with
76 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/message-parser": patch | ||
--- | ||
|
||
fix(message-parser): Made changes in grammar.pegjs for the strikedown approach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { parse } from '../src'; | ||
import { | ||
bold, | ||
inlineCode, | ||
italic, | ||
paragraph, | ||
plain, | ||
strike, | ||
} from '../src/utils'; | ||
|
||
test.each([ | ||
[ | ||
'~~`Striking Inline Code`~~', | ||
[paragraph([strike([inlineCode(plain('Striking Inline Code'))])])], | ||
], | ||
[ | ||
'~~_`Striking Inline Code with Italics`_~~', | ||
[ | ||
paragraph([ | ||
strike([ | ||
italic([inlineCode(plain('Striking Inline Code with Italics'))]), | ||
]), | ||
]), | ||
], | ||
], | ||
[ | ||
'~~**`Striking Inline Code with Bold`**~~', | ||
[ | ||
paragraph([ | ||
strike([bold([inlineCode(plain('Striking Inline Code with Bold'))])]), | ||
]), | ||
], | ||
], | ||
[ | ||
'~~__*`Striking Inline Code with Bold`*__~~', | ||
[ | ||
paragraph([ | ||
strike([ | ||
italic([bold([inlineCode(plain('Striking Inline Code with Bold'))])]), | ||
]), | ||
]), | ||
], | ||
], | ||
])('parses %p', (input, output) => { | ||
expect(parse(input)).toMatchObject(output); | ||
}); |