diff options
Diffstat (limited to 'src/nodes/Callouts.js')
-rw-r--r-- | src/nodes/Callouts.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nodes/Callouts.js b/src/nodes/Callouts.js index f1ffe8482..0f2b2e8de 100644 --- a/src/nodes/Callouts.js +++ b/src/nodes/Callouts.js @@ -47,7 +47,11 @@ export default Node.create({ type: { default: 'info', rendered: false, - parseHTML: element => element.getAttribute('data-callout'), + parseHTML: element => { + return element.getAttribute('data-callout') + || typesAvailable.find((type) => element.classList.contains(type)) + || (element.classList.contains('warning') && 'warn') + }, renderHTML: attributes => { return { 'data-callout': attributes.type, @@ -61,7 +65,11 @@ export default Node.create({ parseHTML() { return [ { - tag: 'div', + tag: 'div.callout', + }, + { + tag: 'p.callout', + priority: 1001, }, ] }, |