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

Change subject: T161558: Only send lints for full parse
......................................................................

T161558: Only send lints for full parse

Change-Id: I08d4dcf1e5f2710238414a6054517ddee251a766
---
M lib/api/routes.js
M lib/logger/linter.js
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/60/345160/1

diff --git a/lib/api/routes.js b/lib/api/routes.js
index 28f93fb..25fc48c 100644
--- a/lib/api/routes.js
+++ b/lib/api/routes.js
@@ -492,6 +492,7 @@
                        var p2;
                        if (typeof wikitext === 'string') {
                                env.setPageSrcInfo(wikitext);
+
                                if (opts.contentmodel) {
                                        env.page.meta.revision.contentmodel = 
opts.contentmodel;
                                }
@@ -514,6 +515,7 @@
 
                                p2 = env.getContentHandler().toHTML(env);
                        } else if (oldid) {
+                               env.pageWithOldid = true;
 
                                // Indicate the MediaWiki revision in a header 
as well for
                                // ease of extraction in clients.
diff --git a/lib/logger/linter.js b/lib/logger/linter.js
index e551513..a90fa7c 100644
--- a/lib/logger/linter.js
+++ b/lib/logger/linter.js
@@ -52,6 +52,11 @@
                        return;
                }
 
+               if (!env.pageWithOldid) {
+                       // We only want to send to the MW API if this was a 
request to
+                       // parse the full page.
+                       return;
+               }
 
                // Only send the request if it the latest revision
                if (env.page.meta.revision.revid === env.page.latest) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08d4dcf1e5f2710238414a6054517ddee251a766
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to