File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -49,13 +49,18 @@ test('nlcst-affix-emoticon-modifier()', function (t) {
49
49
50
50
/* Short-cut to access the CST. */
51
51
function process ( fixture , positionless ) {
52
- var processor = unified ( ) . use ( english ) . use ( plugin ) ;
53
- return processor . run ( processor . parse ( fixture , { position : ! positionless } ) ) ;
52
+ var processor = unified ( ) . use ( english ) . use ( plugin ) . freeze ( ) ;
53
+
54
+ if ( positionless ) {
55
+ processor . Parser . prototype . position = false ;
56
+ }
57
+
58
+ return processor . runSync ( processor . parse ( fixture ) ) ;
54
59
}
55
60
56
61
/* Add modifier to processor. */
57
- function plugin ( processor ) {
58
- processor . Parser . prototype . useFirst ( 'tokenizeSentence' , emojiModifier ) ;
59
- processor . Parser . prototype . useFirst ( 'tokenizeSentence' , emoticonModifier ) ;
60
- processor . Parser . prototype . useFirst ( 'tokenizeParagraph' , modifier ) ;
62
+ function plugin ( ) {
63
+ this . Parser . prototype . useFirst ( 'tokenizeSentence' , emojiModifier ) ;
64
+ this . Parser . prototype . useFirst ( 'tokenizeSentence' , emoticonModifier ) ;
65
+ this . Parser . prototype . useFirst ( 'tokenizeParagraph' , modifier ) ;
61
66
}
You can’t perform that action at this time.
0 commit comments