8000 Image in CSS with `url()` are not made self contained if included in template and not through a CSS file · Issue #8193 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Image in CSS with url() are not made self contained if included in template and not through a CSS file #8193
Closed
@cderv

Description

@cderv

here is how to reproduce:

Get an image

curl -o image.png https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/175px-Markdown-mark.svg.png

Include in CSS Property

---
title: "mwe"
header-includes: |
  <style type="text/css">
    body {
      background-image: url(image.png)
    }
  </style>
---

# Title

Convert to self contained document

pandoc -t html --self-contained -s -o test.html test.md

Image is not embeded

> cat test.html | grep 'background-image'
      background-image: url(image.png)

However, when included inside a CSS file

---
title: "mwe"
---

# Title
body {
  background-image: url(image.png)
}
pandoc -t html --self-contained -s --css style.css -o test.html test.Rmd
$ cat test.html | grep 'background-image'
<style type="text/css">body {background-image: url(data:image/png;base64, <truncated>

Is this a known limitation ? Shouldn't <style> be process the same as CSS file ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0