Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Cannot view the encoeded base64 image in package READMEs #1030

Closed
1 task
yoonhyung opened this issue Dec 15, 2017 · 1 comment · Fixed by #1087
Closed
1 task

Cannot view the encoeded base64 image in package READMEs #1030

yoonhyung opened this issue Dec 15, 2017 · 1 comment · Fixed by #1087

Comments

@yoonhyung
Copy link

Prerequisites

Description

[Description of the issue]
Previously there was a problem with the relative path, so I used the base64 encoded image in the README file. As a result, the version of Atom version 1.22.1 worked well. However, the base64 encoded image is not visible as it is updated to 1.23.0.

So I checked the source(package-readme.view.js) and found that the sanitize function added a new line that merges the packaged path with the image source.

Expected behavior: [What you expect to happen]

it will show the encoeded based64 image in package REAEMEs

Versions

Atom : 1.22.1
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0

apm 1.18.8
npm 3.10.10
node 6.9.5 x64
python 2.7.13
git 2.9.3.windows.1
visual studio 2015

Additional Information

Before merging an image source with a package relative path, you need to check whether it is base64 as a regular expression in that source.

@yoonhyung
Copy link
Author

yoonhyung commented Dec 15, 2017

refer to the below code

in package-readme-view.js

function sanitize(...) {
...
    // if src contains a base64 enconding string then it must be a base64 enconding
    if (/^data:image\/.*;base64/i.test(imageSrc)) {
      changeImageSrc = false;
    }
...
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant