Unable to center images in npm readme
Fl4m3Ph03n1x opened this issue · 1 comments
Problem
I have a project fully documented and with a README which has the logo centered:
https://github.com/Fl4m3Ph03n1x/fs-error-logger/blob/master/README.md
The code I am using for this is the following:
<p align="center">
<img src="./logos/logo_no_wm.png" >
</p>
After reading NPMs documentation, I had the strong impression this same code should work on NPM's markdown:
However, if you check my NPM project, you can see the logo is not centered:
https://www.npmjs.com/package/fs-error-logger
After asking for help around in StackOverflow, someone found tat the previous code is actually being transformed into the following:
<img src="https://raw.githubusercontent.com/Fl4m3Ph03n1x/fs-error-logger/HEAD/logos/logo_no_wm.png" />
<p></p>
Which makes no sense at all.
Questions
- Is this intended behavior? If so why?
- Is this a bug? If so, when will it be fixed?
Hi @Fl4m3Ph03n1x; very interesting!
Turns out marky(yourReadme)
is generating the correct markup on its own, but when we pass your package.json data, e.g., marky(yourReadme, {package: yourPackageJson})
, then it wrecks the output. So that leads me to believe there's a bug in our "github" markdown-it plugin.
To answer your questions:
- Nope, this is not the correct behavior, not at all!
- Yes, definitely a bug. Exact timeline for a fix is difficult to know. Pull requests always welcome from anyone, of course, but for this one, I expect being able to tackle it sooner rather than later.