@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
32 lines (22 loc) • 1.1 kB
JavaScript
;
const { applyCheckboxLabelRemoval } = require('../_shared.cjs');
module.exports = function transformer(fileInfo) {
if (!/\.(html|htm|aspx|cshtml|vbhtml|hbs|handlebars)$/i.test(fileInfo.path)) {
return undefined;
}
let result = fileInfo.source;
result = result.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi, (match, content) => {
const updated = applyCheckboxLabelRemoval(content);
return match.replace(content, updated);
});
result = result.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, (match, content) => {
const updated = applyCheckboxLabelRemoval(content);
return match.replace(content, updated);
});
return result !== fileInfo.source ? result : undefined;
};
module.exports.aiInstructions = `The .k-checkbox-label element was removed from the Checkbox rendering in Kendo UI 2020 R1. This codemod updates inline <style> and <script> blocks in HTML files to remove .k-checkbox-label from compound selectors.
Before:
<style>.k-checkbox-label.k-checked { font-weight: bold; }</style>
After:
<style>.k-checked { font-weight: bold; }</style>`;