You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code syntax highlighting currently only works for GitHub repositories. For GitHub repositories, Packagist uses the GitHub API to fetch the rendered HTML of a readme file. For all other repositories a cebe/markdown is used to render the markdown as HTML which doesn't seem to support code syntax highlighting.
Oh, interesting! Thanks for the explanation, @glaubinix! I thought we'd be using something like highlight.js here... What were the reasons against solving this on the front-end side?
I don't know, but I would assume that the GitHub API call is convenient, covers >95% of installed packages without the need for an additional dependency. So far the lack of code syntax highlighting in other repositories probably just hasn't come up yet.
I assume that syntax highlighting in a
README.md
file seems not to work properly when the repository comes from Bitbucket.Here are to libraries to compare:
In both of them, the PHP code has been written with three backticks, followed by
php
.Strangely enough, the HTML of the rendered documents is different:
From GitHub:
From Bitbucket:
Has anyone an idea what happens here and why?
The text was updated successfully, but these errors were encountered: