Add MD049/emphasis-style (fixes #150).

This commit is contained in:
Sébastien Règne 2021-10-24 06:54:58 +02:00 committed by GitHub
parent aa8aa83db8
commit 39724b991a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 418 additions and 35 deletions

View file

@ -4039,6 +4039,36 @@ module.exports = {
};
/***/ }),
/***/ "../lib/md049.js":
/*!***********************!*\
!*** ../lib/md049.js ***!
\***********************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
// @ts-check
var _a = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"), addErrorDetailIf = _a.addErrorDetailIf, emphasisOrStrongStyleFor = _a.emphasisOrStrongStyleFor, forEachInlineChild = _a.forEachInlineChild;
module.exports = {
"names": ["MD049", "emphasis-style"],
"description": "Emphasis style should be consistent",
"tags": ["emphasis"],
"function": function MD049(params, onError) {
var expectedStyle = String(params.config.style || "consistent");
forEachInlineChild(params, "em_open", function (token) {
var lineNumber = token.lineNumber, markup = token.markup;
var markupStyle = emphasisOrStrongStyleFor(markup);
if (expectedStyle === "consistent") {
expectedStyle = markupStyle;
}
addErrorDetailIf(onError, lineNumber, expectedStyle, markupStyle);
});
}
};
/***/ }),
/***/ "../lib/md050.js":
@ -4128,6 +4158,7 @@ var rules = [
__webpack_require__(/*! ./md046 */ "../lib/md046.js"),
__webpack_require__(/*! ./md047 */ "../lib/md047.js"),
__webpack_require__(/*! ./md048 */ "../lib/md048.js"),
__webpack_require__(/*! ./md049 */ "../lib/md049.js"),
__webpack_require__(/*! ./md050 */ "../lib/md050.js")
];
rules.forEach(function (rule) {