| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /**
- * @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( 'images', () => {
- it( 'should process images', () => {
- testDataProcessor(
- '',
- // GitHub is rendering as:
- // <p><a href="..." target="_blank"><img src="..." alt="..." title="..." data-canonical-src="..."></a></p>
- // We will handle images separately by features.
- '<p><img alt="alt text" src="http://example.com/image.png" title="title text"></img></p>'
- );
- } );
- it( 'should process images without title', () => {
- testDataProcessor(
- '',
- '<p><img alt="alt text" src="http://example.com/image.png"></img></p>'
- );
- } );
- it( 'should process images without alt text', () => {
- testDataProcessor(
- '',
- '<p><img alt="" src="http://example.com/image.png" title="title text"></img></p>'
- );
- } );
- it( 'should process referenced images', () => {
- testDataProcessor(
- '![alt text][logo]\n\n' +
- '[logo]: http://example.com/image.png "title text"',
- '<p><img alt="alt text" src="http://example.com/image.png" title="title text"></img></p>',
- // Referenced images when converting back are converted to direct links.
- ''
- );
- } );
- it( 'should process referenced images without title', () => {
- testDataProcessor(
- '![alt text][logo]\n\n' +
- '[logo]: http://example.com/image.png',
- '<p><img alt="alt text" src="http://example.com/image.png"></img></p>',
- // Referenced images when converting back are converted to direct links.
- ''
- );
- } );
- it( 'should process referenced images without alt text', () => {
- testDataProcessor(
- '![][logo]\n\n' +
- '[logo]: http://example.com/image.png "title text"',
- '<p><img alt="" src="http://example.com/image.png" title="title text"></img></p>',
- // Referenced images when converting back are converted to direct links.
- ''
- );
- } );
- } );
- } );
|