Sha256: d0c5df206d3fe1da303fa142aec671ad996b164bb649c545e03beda49f118c56
Contents?: true
Size: 615 Bytes
Versions: 10
Compression:
Stored size: 615 Bytes
Contents
Editor.Parsers.add 'image', class rule: /^(!{1}\[([^\]]+)\])(\(([^\s]+)?\))$/i constructor: (node) -> @walker = document.createTreeWalker(node, NodeFilter.SHOW_TEXT) isMatched: => @match = @rule.exec(@walker.root.textContent) @match? render: => @figure = EditorElements.content.querySelector("[as='Editor.Image']").cloneNode(true) @caption = @figure.querySelector('figcaption') @caption.appendChild document.createTextNode(@match[1]) @caption.appendChild document.createTextNode(@match[3]) if @match[4]? @caption.setAttribute('name', @match[4]) return @figure
Version data entries
10 entries across 10 versions & 1 rubygems