Strange issue with data-uri

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange issue with data-uri

ch007m
I have added to my document.html.slim a section to include a logo header.

    - unless noheader
      / AsciiDoc leaves an empty header div even if there's no doctitle
      #header
        - if has_header?
          - if attr? :header_image_path
            img src=image_uri(attr :header_image_path)

 That works very well and the picture is added to the HTML generated

<div id="header"><img src="/Users/chmoulli/hyla/MyBlankProject/image/logo.png">

What I don't understand is that why the picture is not embedded in the html  as "<img src="data:image ... >" ?

When I debug the code this method :

    elsif @document.safe < Asciidoctor::SafeMode::SECURE && @document.attr?('data-uri')
      generate_data_uri(target_image, asset_dir_key)
    elsif

receives well result of

"data:#{mimetype};base64,#{Base64.encode64(bindata).delete("\n")}"

Do I miss something ?

Regards,
Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard
Reply | Threaded
Open this post in threaded view
|

Re: Strange issue with data-uri

ch007m
Typo error. Error fixed.
Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard