import Quill from 'quill'

let Embed = Quill.import('blots/embed');

class StImage extends Embed {
    static create(value) {
        // console.log('create value:', value);
        let node = super.create();
        node.setAttribute('data-latex', value['data-latex']);
        node.setAttribute('src', value['src']);
        return node;
    }

    static value(node) {
        // console.log('value node:', node);
        return {
            'data-latex': node.getAttribute('data-latex'),
            'src': node.getAttribute('src'),
        };
    }
}
StImage.blotName = 'stimage';
StImage.tagName = 'img';

export default StImage
