lib/ecrire/app/assets/javascripts/admin/editor/ext.coffee in ecrire-0.20.0 vs lib/ecrire/app/assets/javascripts/admin/editor/ext.coffee in ecrire-0.21.0
- old
+ new
@@ -12,13 +12,19 @@
HTMLOListElement::toString = HTMLUListElement::toString = ->
texts = Array.prototype.slice.call(@children).map (li) ->
li.textContent
texts.join("\n")
-HTMLPictureElement::toString = ->
- @lastChild.textContent
+HTMLDivElement::toString = ->
+ if @classList.contains('image')
+ @lastChild.textContent
+ else
+ @textContent
-HTMLPreElement::toString = HTMLHeadingElement::toString = HTMLDivElement::toString = HTMLParagraphElement::toString = ->
+HTMLPreElement::toString = ->
+ @textContent
+
+HTMLHeadingElement::toString = HTMLParagraphElement::toString = ->
@textContent
HTMLElement::offset = (node, walker) ->
offset = 0