add initial marp implementation with sample content and build configuration
This commit is contained in:
24
node_modules/speech-rule-engine/mjs/highlighter/css_highlighter.js
generated
vendored
Normal file
24
node_modules/speech-rule-engine/mjs/highlighter/css_highlighter.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { AbstractHighlighter } from './abstract_highlighter.js';
|
||||
export class CssHighlighter extends AbstractHighlighter {
|
||||
constructor() {
|
||||
super();
|
||||
this.mactionName = 'mjx-maction';
|
||||
}
|
||||
highlightNode(node) {
|
||||
const info = {
|
||||
node: node,
|
||||
background: node.style.backgroundColor,
|
||||
foreground: node.style.color
|
||||
};
|
||||
if (!this.isHighlighted(node)) {
|
||||
const color = this.colorString();
|
||||
node.style.backgroundColor = color.background;
|
||||
node.style.color = color.foreground;
|
||||
}
|
||||
return info;
|
||||
}
|
||||
unhighlightNode(info) {
|
||||
info.node.style.backgroundColor = info.background;
|
||||
info.node.style.color = info.foreground;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user