-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'i/github-writer/93' into i/5988
- Loading branch information
Showing
2 changed files
with
78 additions
and
4 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
43 changes: 43 additions & 0 deletions
43
packages/ckeditor5-markdown-gfm/tests/gfmdataprocessor/text.js
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,43 @@ | ||
/** | ||
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
import { testDataProcessor } from '../_utils/utils'; | ||
|
||
describe( 'GFMDataProcessor', () => { | ||
describe( 'text', () => { | ||
describe( 'urls', () => { | ||
it( 'should not escape urls', () => { | ||
testDataProcessor( | ||
'escape\\_this https://test.com/do_[not]-escape escape\\_this', | ||
'<p>escape_this https://test.com/do_[not]-escape escape_this</p>' | ||
); | ||
} ); | ||
|
||
it( 'should not escape urls (at start)', () => { | ||
testDataProcessor( | ||
'https://test.com/do_[not]-escape escape\\_this', | ||
'<p>https://test.com/do_[not]-escape escape_this</p>' | ||
); | ||
} ); | ||
|
||
it( 'should not escape urls (at end)', () => { | ||
testDataProcessor( | ||
'escape\\_this https://test.com/do_[not]-escape', | ||
'<p>escape_this https://test.com/do_[not]-escape</p>' | ||
); | ||
} ); | ||
|
||
[ | ||
'https://test.com/do_[not]-escape', | ||
'http://test.com/do_[not]-escape', | ||
'www.test.com/do_[not]-escape' | ||
].forEach( url => { | ||
it( `should not escape urls (${ url })`, () => { | ||
testDataProcessor( url, `<p>${ url }</p>` ); | ||
} ); | ||
} ); | ||
} ); | ||
} ); | ||
} ); |