markdown-it-alert
Version:
Create alerts for markdown
42 lines • 1.26 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = __importDefault(require(".."));
const markdown_it_1 = __importDefault(require("markdown-it"));
const md = new markdown_it_1.default();
const exampleInput = `
::: tip
This is a tip
:::
`;
describe("BEM", () => {
it("Markdown Alert should be rendered with normal syntax", () => {
md.use(__1.default, { bem: false });
try {
const renderedDocument = md.render(exampleInput);
expect(renderedDocument).toEqual(`<div class="alert alert-tip" role="alert">
<p>This is a tip</p>
</div>
`);
}
catch (err) {
throw Error(err);
}
});
it("Markdown Alert should be rendered with BEM syntax", () => {
md.use(__1.default, { bem: true });
try {
const renderedDocument = md.render(exampleInput);
expect(renderedDocument).toEqual(`<div class="alert alert--tip" role="alert">
<p>This is a tip</p>
</div>
`);
}
catch (err) {
throw Error(err);
}
});
});
//# sourceMappingURL=bem.spec.js.map