|
@@ -16,7 +16,6 @@ import ModelRange from '/ckeditor5/engine/treemodel/range.js';
|
|
|
import ModelPosition from '/ckeditor5/engine/treemodel/position.js';
|
|
import ModelPosition from '/ckeditor5/engine/treemodel/position.js';
|
|
|
import ModelWalker from '/ckeditor5/engine/treemodel/treewalker.js';
|
|
import ModelWalker from '/ckeditor5/engine/treemodel/treewalker.js';
|
|
|
|
|
|
|
|
-import ViewDocumentFragment from '/ckeditor5/engine/treeview/documentfragment.js';
|
|
|
|
|
import ViewElement from '/ckeditor5/engine/treeview/element.js';
|
|
import ViewElement from '/ckeditor5/engine/treeview/element.js';
|
|
|
import ViewContainerElement from '/ckeditor5/engine/treeview/containerelement.js';
|
|
import ViewContainerElement from '/ckeditor5/engine/treeview/containerelement.js';
|
|
|
import ViewAttributeElement from '/ckeditor5/engine/treeview/attributeelement.js';
|
|
import ViewAttributeElement from '/ckeditor5/engine/treeview/attributeelement.js';
|
|
@@ -460,7 +459,6 @@ describe( 'custom attribute handling for given element', () => {
|
|
|
} );
|
|
} );
|
|
|
modelDispatcher.on( 'removeAttribute:linkTitle:quote', modelChangeLinkAttrQuoteConverter );
|
|
modelDispatcher.on( 'removeAttribute:linkTitle:quote', modelChangeLinkAttrQuoteConverter );
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// QUOTE VIEW TO MODEL CONVERTERS
|
|
// QUOTE VIEW TO MODEL CONVERTERS
|
|
|
viewDispatcher.on( 'element:blockquote', ( evt, data, consumable, conversionApi ) => {
|
|
viewDispatcher.on( 'element:blockquote', ( evt, data, consumable, conversionApi ) => {
|
|
|
if ( consumable.consume( data.input, { name: true } ) ) {
|
|
if ( consumable.consume( data.input, { name: true } ) ) {
|
|
@@ -495,7 +493,7 @@ describe( 'custom attribute handling for given element', () => {
|
|
|
|
|
|
|
|
// The expected value is different than in example or than what is really expected as it should be one link,
|
|
// The expected value is different than in example or than what is really expected as it should be one link,
|
|
|
// but writer does not have merging feature yet.
|
|
// but writer does not have merging feature yet.
|
|
|
- expect( viewToString( viewRoot ) ).to.equal( '<div><a title="Foo title"><a href="foo.html">foo</a></a></div>' );
|
|
|
|
|
|
|
+ expect( viewToString( viewRoot ) ).to.equal( '<div><a href="foo.html" title="Foo title">foo</a></div>' );
|
|
|
|
|
|
|
|
// Let's change link's attributes.
|
|
// Let's change link's attributes.
|
|
|
for ( let value of range ) {
|
|
for ( let value of range ) {
|
|
@@ -505,7 +503,7 @@ describe( 'custom attribute handling for given element', () => {
|
|
|
modelDispatcher.convertAttribute( 'changeAttribute', range, 'linkHref', 'foo.html', 'bar.html' );
|
|
modelDispatcher.convertAttribute( 'changeAttribute', range, 'linkHref', 'foo.html', 'bar.html' );
|
|
|
modelDispatcher.convertAttribute( 'changeAttribute', range, 'linkTitle', 'Foo title', 'Bar title' );
|
|
modelDispatcher.convertAttribute( 'changeAttribute', range, 'linkTitle', 'Foo title', 'Bar title' );
|
|
|
|
|
|
|
|
- expect( viewToString( viewRoot ) ).to.equal( '<div><a title="Bar title"><a href="bar.html">foo</a></a></div>' );
|
|
|
|
|
|
|
+ expect( viewToString( viewRoot ) ).to.equal( '<div><a href="bar.html" title="Bar title">foo</a></div>' );
|
|
|
|
|
|
|
|
// Let's remove a letter from the link.
|
|
// Let's remove a letter from the link.
|
|
|
const removed = modelRoot.removeChildren( 0, 1 );
|
|
const removed = modelRoot.removeChildren( 0, 1 );
|
|
@@ -515,7 +513,7 @@ describe( 'custom attribute handling for given element', () => {
|
|
|
ModelRange.createFromElement( modelDoc.graveyard )
|
|
ModelRange.createFromElement( modelDoc.graveyard )
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- expect( viewToString( viewRoot ) ).to.equal( '<div><a title="Bar title"><a href="bar.html">oo</a></a></div>' );
|
|
|
|
|
|
|
+ expect( viewToString( viewRoot ) ).to.equal( '<div><a href="bar.html" title="Bar title">oo</a></div>' );
|
|
|
|
|
|
|
|
range = ModelRange.createFromElement( modelRoot );
|
|
range = ModelRange.createFromElement( modelRoot );
|
|
|
|
|
|
|
@@ -591,7 +589,7 @@ describe( 'custom attribute handling for given element', () => {
|
|
|
'a',
|
|
'a',
|
|
|
{
|
|
{
|
|
|
href: 'foo.html',
|
|
href: 'foo.html',
|
|
|
- title:'Foo source'
|
|
|
|
|
|
|
+ title: 'Foo source'
|
|
|
},
|
|
},
|
|
|
new ViewText( 'see source' )
|
|
new ViewText( 'see source' )
|
|
|
)
|
|
)
|
|
@@ -661,7 +659,8 @@ it( 'default table view to model converter', () => {
|
|
|
let model = viewDispatcher.convert( viewTable );
|
|
let model = viewDispatcher.convert( viewTable );
|
|
|
let modelFragment = new ModelDocumentFragment( model );
|
|
let modelFragment = new ModelDocumentFragment( model );
|
|
|
|
|
|
|
|
- expect( modelToString( modelFragment ) ).to.equal( '<paragraph>foo <$text linkHref="bar.html">bar</$text></paragraph><paragraph>abc</paragraph>' );
|
|
|
|
|
|
|
+ expect( modelToString( modelFragment ) )
|
|
|
|
|
+ .to.equal( '<paragraph>foo <$text linkHref="bar.html">bar</$text></paragraph><paragraph>abc</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
// Model converter that converts any non-converted elements and attributes into view elements and attributes.
|
|
// Model converter that converts any non-converted elements and attributes into view elements and attributes.
|