Skip to content

Duplicated images if buffer with tabs in images are untabified #51

@TobiasZawada

Description

@TobiasZawada

The following lisp-code creates a buffer *test* with an embedded svg image data.

If htmlize-untabify is t, then the image appears as replacement for every tab in the HTML file generated with htmlize-buffer – three times overall.

This is because htmlize-untabify-string accidently puts the display property
with the image on the corresponding table entry in htmlize-tab-spaces.

(with-current-buffer (get-buffer-create "*test*")
  (let (b e)
    (erase-buffer)
    (insert "\t  Text before\n\t")
    (setq b (point))
    (insert (propertize "bold\n" 'face 'bold)
	    (propertize "\titalic\n" 'face 'italic))
    (setq e (point))
    (insert "\n\tText after")
    (let ((ol (make-overlay b e)))
      (overlay-put
       ol
       'display
       (create-image
	"<svg height=\"140\" width=\"500\" xmlns=\"http://www.w3.org/2000/svg\">
  <ellipse rx=\"100\" ry=\"50\" cx=\"120\" cy=\"80\"
  style=\"fill:yellow;stroke:green;stroke-width:3\" />
</svg>"
	'svg
	t)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions