How to use the mediawiki-title.Title function in mediawiki-title

To help you get started, we’ve selected a few mediawiki-title examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wikimedia / restbase / lib / mwUtil.js View on Github external
'use strict';

const uuidUtils = require('./uuidUtils');
const contentType = require('content-type');
const jwt = require('jsonwebtoken');
const P = require('bluebird');
const entities = require('entities');
const Title = require('mediawiki-title').Title;
const HyperSwitch = require('hyperswitch');
const querystring = require('querystring');
const cType = require('content-type');
const HTTPError = HyperSwitch.HTTPError;
const URI = HyperSwitch.URI;
const mwUtil = {};

/**
 * Create an etag value of the form
 * "//"
 * @param   {Integer}   rev         page revision number
 * @param   {string}    tid         page render UUID
 * @param   {string}    [suffix]    optional suffix
 * @return  {string}                the value of the ETag header
 */
mwUtil.makeETag = (rev, tid, suffix) => {
github wikimedia / restbase / v1 / lists.js View on Github external
'use strict';

const P = require('bluebird');
const mwUtil = require('../lib/mwUtil');
const Title = require('mediawiki-title').Title;
const HyperSwitch = require('hyperswitch');
const URI = HyperSwitch.URI;
const spec = HyperSwitch.utils.loadSpec(`${__dirname}/lists.yaml`);

class ReadingLists {
    /**
     * @param {!Object} options RESTBase options object.
     */
    constructor(options) {
        this.options = options;
    }

    /**
     * Transform the continuation data into a string so it is easier for clients to deal with.
     * @param  {!Object|undefined} continuation Continuation object returned by the MediaWiki API.
     * @return {!string|undefined}              Continuation string.
github wikimedia / parsoid / lib / config / MWParserEnvironment.js View on Github external
/**
 * Main parser environment object.  Holds configuration data that isn't
 * modified at runtime, debugging objects, a page object that represents
 * the article we're parsing, and more.
 *
 * @module
 */

'use strict';

require('../../core-upgrade.js');

var semver = require('semver');
var Title = require('mediawiki-title').Title;
var Promise = require('../utils/promise.js');
var WikiConfig = require('./WikiConfig.js').WikiConfig;
var ConfigRequest = require('../mw/ApiRequest.js').ConfigRequest;
var Batcher = require('../mw/Batcher.js').Batcher;
var ContentUtils = require('../utils/ContentUtils.js').ContentUtils;
var DOMUtils = require('../utils/DOMUtils.js').DOMUtils;
var DOMDataUtils = require('../utils/DOMDataUtils.js').DOMDataUtils;
var Util = require('../utils/Util.js').Util;
var JSUtils = require('../utils/jsutils.js').JSUtils;
var TokenUtils = require('../utils/TokenUtils.js').TokenUtils;
var PipelineUtils = require('../utils/PipelineUtils.js').PipelineUtils;
var ParserPipelineFactory = require('../wt2html/parser.js').ParserPipelineFactory;
var LintLogger = require('../logger/LintLogger.js').LintLogger;
var ParsoidLogger = require('../logger/ParsoidLogger.js').ParsoidLogger;
var Sanitizer = require('../wt2html/tt/Sanitizer.js').Sanitizer;

mediawiki-title

Title normalization library for mediawiki

Apache-2.0
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis