Files
formipay/node_modules/markdownlint/lib/md034.js
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:02:14 +07:00

62 lines
2.0 KiB
JavaScript

// @ts-check
"use strict";
const { addErrorContext, bareUrlRe, filterTokens } = require("../helpers");
module.exports = {
"names": [ "MD034", "no-bare-urls" ],
"description": "Bare URL used",
"tags": [ "links", "url" ],
"function": function MD034(params, onError) {
filterTokens(params, "inline", (token) => {
let inLink = false;
token.children.forEach((child) => {
const { content, line, lineNumber, type } = child;
let match = null;
if (type === "link_open") {
inLink = true;
} else if (type === "link_close") {
inLink = false;
} else if ((type === "text") && !inLink) {
while ((match = bareUrlRe.exec(content)) !== null) {
const [ bareUrl ] = match;
const matchIndex = match.index;
const bareUrlLength = bareUrl.length;
// Allow "[https://example.com]" to avoid conflicts with
// MD011/no-reversed-links; allow quoting as another way
// of deliberately including a bare URL
const leftChar = content[matchIndex - 1];
const rightChar = content[matchIndex + bareUrlLength];
if (
!((leftChar === "[") && (rightChar === "]")) &&
!((leftChar === "\"") && (rightChar === "\"")) &&
!((leftChar === "'") && (rightChar === "'"))
) {
const index = line.indexOf(content);
const range = (index === -1) ? null : [
index + matchIndex + 1,
bareUrlLength
];
const fixInfo = range ? {
"editColumn": range[0],
"deleteCount": range[1],
"insertText": `<${bareUrl}>`
} : null;
addErrorContext(
onError,
lineNumber,
bareUrl,
null,
null,
range,
fixInfo
);
}
}
}
});
});
}
};