Subramanya Sastry has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/359616 )
Change subject: Minor: DRYing of requires ...................................................................... Minor: DRYing of requires Change-Id: I6f83275d2fd61759935b6ab731d92dcd981334f3 --- M lib/wt2html/DOMPostProcessor.js 1 file changed, 24 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/16/359616/1 diff --git a/lib/wt2html/DOMPostProcessor.js b/lib/wt2html/DOMPostProcessor.js index 8935b42..ba0b82d 100644 --- a/lib/wt2html/DOMPostProcessor.js +++ b/lib/wt2html/DOMPostProcessor.js @@ -13,25 +13,32 @@ var DOMTraverser = require('../utils/DOMTraverser.js').DOMTraverser; // processors -var markFosteredContent = require('./pp/processors/markFosteredContent.js').markFosteredContent; -var handleUnbalancedTables = require('./pp/processors/handleUnbalancedTables.js').handleUnbalancedTables; -var markTreeBuilderFixups = require('./pp/processors/markTreeBuilderFixups.js').markTreeBuilderFixups; -var normalize = require('./pp/processors/normalize.js').normalize; -var cleanupFormattingTagFixup = require('./pp/processors/cleanupFormattingTagFixup.js').cleanupFormattingTagFixup; -var migrateTemplateMarkerMetas = require('./pp/processors/migrateTemplateMarkerMetas.js').migrateTemplateMarkerMetas; -var handlePres = require('./pp/processors/handlePres.js').handlePres; -var migrateTrailingNLs = require('./pp/processors/migrateTrailingNLs.js').migrateTrailingNLs; -var computeDSR = require('./pp/processors/computeDSR.js').computeDSR; -var wrapTemplates = require('./pp/processors/wrapTemplates.js').wrapTemplates; +var requireProcessor = function(p) { + return require('./pp/processors/' + p + '.js')[p]; +}; +var markFosteredContent = requireProcessor('markFosteredContent'); +var handleUnbalancedTables = requireProcessor('handleUnbalancedTables'); +var markTreeBuilderFixups = requireProcessor('markTreeBuilderFixups'); +var normalize = requireProcessor('normalize'); +var cleanupFormattingTagFixup = requireProcessor('cleanupFormattingTagFixup'); +var migrateTemplateMarkerMetas = requireProcessor('migrateTemplateMarkerMetas'); +var handlePres = requireProcessor('handlePres'); +var migrateTrailingNLs = requireProcessor('migrateTrailingNLs'); +var computeDSR = requireProcessor('computeDSR'); +var wrapTemplates = requireProcessor('wrapTemplates'); // handlers -var logWikitextFixup = require('./pp/handlers/linter.js').logWikitextFixups; -var CleanUp = require('./pp/handlers/cleanup.js'); -var headings = require('./pp/handlers/headings.js'); -var unpackDOMFragments = require('./pp/handlers/unpackDOMFragments.js').unpackDOMFragments; -var TableFixups = require('./pp/handlers/tableFixups.js').TableFixups; -var handleLinkNeighbours = require('./pp/handlers/handleLinkNeighbours.js').handleLinkNeighbours; -var liFixups = require('./pp/handlers/liFixups.js'); +var requireHandlers = function(file) { + return require('./pp/handlers/' + file + '.js'); +}; + +var logWikitextFixup = requireHandlers('linter').logWikitextFixups; +var CleanUp = requireHandlers('cleanup'); +var headings = requireHandlers('headings'); +var unpackDOMFragments = requireHandlers('unpackDOMFragments').unpackDOMFragments; +var TableFixups = requireHandlers('tableFixups').TableFixups; +var handleLinkNeighbours = requireHandlers('handleLinkNeighbours').handleLinkNeighbours; +var liFixups = requireHandlers('liFixups'); // map from mediawiki metadata names to RDFa property names var metadataMap = { -- To view, visit https://gerrit.wikimedia.org/r/359616 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f83275d2fd61759935b6ab731d92dcd981334f3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry <ssas...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits