mirror of
https://github.com/javalent/markdown-attributes.git
synced 2026-07-22 05:40:25 +00:00
feat: now supports math blocks (closes #4)
This commit is contained in:
parent
bfe8344597
commit
96c1935e0d
1 changed files with 6 additions and 3 deletions
|
|
@ -37,7 +37,7 @@ export default class MarkdownAttributes extends Plugin {
|
|||
|
||||
/** Get the source for this element. Only look at the top line for code blocks. */
|
||||
let source = text.split("\n").slice(lineStart, lineStart + 1);
|
||||
let str = source.join("\n");
|
||||
str = source.join("\n");
|
||||
/** Test if the element contains attributes. */
|
||||
if (!Processor.BASE_RE.test(str)) return;
|
||||
|
||||
|
|
@ -47,10 +47,13 @@ export default class MarkdownAttributes extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* Table elements should check the next line in the source to see if it is a single block attribute,
|
||||
* Table elements and Mathjax elements should check the next line in the source to see if it is a single block attribute,
|
||||
* because those block attributes are not applied to the table.
|
||||
*/
|
||||
if (child instanceof HTMLTableElement) {
|
||||
if (
|
||||
child instanceof HTMLTableElement ||
|
||||
(child.hasClass("math") && child.hasClass("math-block"))
|
||||
) {
|
||||
if (!ctx.getSectionInfo(topElement)) return;
|
||||
|
||||
/** Pull the Section data. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue