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:
https://github.com/npm/marky-markdown/pull/242
However, if you check my NPM project, you can see the logo is not centered: https://www.npmjs.com/package/fs-error-logger
How do I fix this?
This could be a bug or an intentional decision by the developers. I suggest filing a bug report.
A view of the page's source code reveals the following HTML for that image:
<img src="https://raw.githubusercontent.com/Fl4m3Ph03n1x/fs-error-logger/HEAD/logos/logo_no_wm.png" />
<p></p>
There are a couple things to note there. First, the image is not wrapped in a p
tag, which is weird. Second, there is an empty p
element immediately following. This could be a bug in their system, or an artifact of their HTML sanitation.
According to an HTML comment in the HTML source, marky-markdown is the markdown parser used. That project's documentation states in part:
What it does
- Parses markdown with markdown-it, a fast and commonmark-compliant parser.
- Removes broken and malicious user input with sanitize-html
It then continues with a bunch of other post-processing steps. I checked and markdown-it passes the raw HTML through just fine, so presumably one of the post-processors is altering the output in some way. Or possibly, marky-markdown's modification of the markdown-it parser has broken something.
What I don't know is if this was an intentional decision by the marky-markdown developers or a bug. If it was intentional, then you may not ever be able to get your desired behavior. Either way, filing a bug report is the best way to get any answer.
For future reference, and for anyone else encountering this problem, the bug report is here. The response is that this is in fact a bug and a fix is already pending.