Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381951 )

Change subject: Adapter#getAdaper: Do not ignore mismatch with explicit tags 
and rdfa
......................................................................

Adapter#getAdaper: Do not ignore mismatch with explicit tags and rdfa

If tags is defined and an element could not match with any of it,
do not proceed with rdfa matching.

For example, an inline image with <span> tag with typeof="mw:Image/Frameless"
will match MWImage translation unit now eventhough the tags does not
define span. It defines only <figure>

Change-Id: Ic39cf1f1aa89137407b62396887761e5db9cbab6
---
M lib/Adapter.js
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/51/381951/1

diff --git a/lib/Adapter.js b/lib/Adapter.js
index 167a415..64c4c8e 100644
--- a/lib/Adapter.js
+++ b/lib/Adapter.js
@@ -33,9 +33,18 @@
                        let translationUnit = translationUnits[ name ];
                        if ( translationUnit.matchTagNames ) {
                                match = translationUnit.matchTagNames.includes( 
element.name );
+
+                               if ( !match ) {
+                                       // If matchTagNames is explicitly 
defined, a match is must.
+                                       break;
+                               }
                        }
                        if ( translationUnit.matchRdfaTypes ) {
                                match = 
translationUnit.matchRdfaTypes.includes( element.attributes.rel ) || 
translationUnit.matchRdfaTypes.includes( element.attributes.typeof );
+                               if ( !match ) {
+                                       // If matchRdfaTypes is explicitly 
defined, a match is must.
+                                       break;
+                               }
                        }
                        if ( match ) {
                                break;

-- 
To view, visit https://gerrit.wikimedia.org/r/381951
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic39cf1f1aa89137407b62396887761e5db9cbab6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to