Allow 'nofollow' on external links in Parsoid output

Bug: T321437
Change-Id: I4070b3b16c8b2b76a0e7a67599efd914cbde63aa
This commit is contained in:
Bartosz Dziewoński 2022-10-24 18:36:31 +02:00
parent e115c05504
commit fdb7390d27
3 changed files with 8 additions and 0 deletions

View file

@ -35,6 +35,8 @@ OO.inheritClass( ve.dm.MWExternalLinkAnnotation, ve.dm.LinkAnnotation );
ve.dm.MWExternalLinkAnnotation.static.name = 'link/mwExternal'; ve.dm.MWExternalLinkAnnotation.static.name = 'link/mwExternal';
// Allow 'nofollow' in Parsoid output (T321437)
// Allow all unknown types for external paste (handled in toDataElement)
ve.dm.MWExternalLinkAnnotation.static.allowedRdfaTypes = null; ve.dm.MWExternalLinkAnnotation.static.allowedRdfaTypes = null;
ve.dm.MWExternalLinkAnnotation.static.toDataElement = function ( domElements, converter ) { ve.dm.MWExternalLinkAnnotation.static.toDataElement = function ( domElements, converter ) {

View file

@ -39,6 +39,9 @@ ve.dm.MWMagicLinkNode.static.matchTagNames = [ 'a' ];
ve.dm.MWMagicLinkNode.static.matchRdfaTypes = [ 'mw:WikiLink', 'mw:ExtLink' ]; ve.dm.MWMagicLinkNode.static.matchRdfaTypes = [ 'mw:WikiLink', 'mw:ExtLink' ];
// Allow 'nofollow' in Parsoid output (T321437)
ve.dm.MWMagicLinkNode.static.allowedRdfaTypes = [ 'nofollow' ];
ve.dm.MWMagicLinkNode.static.disallowedAnnotationTypes = [ 'link' ]; ve.dm.MWMagicLinkNode.static.disallowedAnnotationTypes = [ 'link' ];
/** /**

View file

@ -39,6 +39,9 @@ ve.dm.MWNumberedExternalLinkNode.static.matchTagNames = [ 'a' ];
ve.dm.MWNumberedExternalLinkNode.static.matchRdfaTypes = [ 'mw:ExtLink', 've:NumberedLink' ]; ve.dm.MWNumberedExternalLinkNode.static.matchRdfaTypes = [ 'mw:ExtLink', 've:NumberedLink' ];
// Allow 'nofollow' in Parsoid output (T321437)
ve.dm.MWNumberedExternalLinkNode.static.allowedRdfaTypes = [ 'nofollow' ];
ve.dm.MWNumberedExternalLinkNode.static.disallowedAnnotationTypes = [ 'link' ]; ve.dm.MWNumberedExternalLinkNode.static.disallowedAnnotationTypes = [ 'link' ];
ve.dm.MWNumberedExternalLinkNode.static.matchFunction = function ( domElement ) { ve.dm.MWNumberedExternalLinkNode.static.matchFunction = function ( domElement ) {