Changes
2 changed files (+60/-1)
-
-
@@ -4,7 +4,7 @@ import { explicit, or, regexp, topOfLine } from './combinator'const parseBold = explicit( regexp( /^\*(\S([^*\n]*?|[^*\n]*? `.*?` )\S|\S)\*(?=[\s.,\])}!?\-=]|$)/, /^\*(\S([^*\n]*?|[^*\n]*? `.*?` )[^\s*]|\S)\*(?=[\s~!#$%^)\-+={}[\];:'",.?/]|$)/, (match, text, position, parseText) => { const [matchedText, content] = match
-
-
-
@@ -59,3 +59,62 @@ root([text('Test:\nTest 2:\nTest 3:')])) }) }) // https://github.com/pocka/slack-message-parser/issues/34 describe('#34', () => { it('parses bold formatting properly with various punctuation suffixes', () => { expect( parse( '*Y*~ *N*` *Y*! *N*@ *Y*# *Y*$ *Y*% *Y*^ *N*& *N** *N*( *Y*) *N*_ *Y*- *Y*+ *Y*= *Y*{ *Y*} *Y*[ *Y*] *N*| *N*\\ *Y*; *Y*: *Y*\' *Y*" *N*< *Y*, *N*> *Y*. *Y*? *Y*/ *Y*' ) ).toEqual( root([ bold([text('Y')]), text('~ *N*` '), bold([text('Y')]), text('! *N*@ '), bold([text('Y')]), text('# '), bold([text('Y')]), text('$ '), bold([text('Y')]), text('% '), bold([text('Y')]), text('^ *N*& *N** *N*( '), bold([text('Y')]), text(') *N*_ '), bold([text('Y')]), text('- '), bold([text('Y')]), text('+ '), bold([text('Y')]), text('= '), bold([text('Y')]), text('{ '), bold([text('Y')]), text('} '), bold([text('Y')]), text('[ '), bold([text('Y')]), text('] *N*| *N*\\ '), bold([text('Y')]), text('; '), bold([text('Y')]), text(': '), bold([text('Y')]), text("' "), bold([text('Y')]), text('" *N*< '), bold([text('Y')]), text(', *N*> '), bold([text('Y')]), text('. '), bold([text('Y')]), text('? '), bold([text('Y')]), text('/ '), bold([text('Y')]) ]) ) }) })
-