Skip to content

Commit

Permalink
Add special handling for images within floating notes, which are not …
Browse files Browse the repository at this point in the history
…part of any paragraph.
  • Loading branch information
rupor-github committed Jul 22, 2024
1 parent 5ccf9b2 commit 31f56ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion processor/xhtml.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,12 @@ func (p *Processor) transfer(from, to *etree.Element, decorations ...string) err

// special case - transferring note body
if to.Tag == "note-root" && len(tag) > 0 && tag != "p" && len(css) == 0 && len(href) == 0 {
css, tag = tag, "div"
if tag != "image" {
css, tag = tag, "div"
} else {
// special case - some notes may contain images, but not inside paragraphs...
return transferImage(p, from, to)
}
}

text := from.Text()
Expand Down

0 comments on commit 31f56ff

Please sign in to comment.