GitHub pages not rendering HTML in markdown (eg. "a" tags)
In a recent deploy of this blog – which is powered by jekyll and github-pages, I found out that a tags stop working. Those links were broken.
After a quick study, I found a hint in github/pages-gem/releases/tag/v225
Apparently GitHub pages did a change on 2022-03-04. Now you need to pass UNSAFE
option to
jekyll-commonmark-ghpages
via commonmark
options in order to make it work.
In my case, I add the UNSAFE
option, deploy again and it’s back to normal.
in _config.yml
:
commonmark:
- options: ["SMART", "FOOTNOTES"]
+ options: ["UNSAFE", "SMART", "FOOTNOTES"]
extensions: ["strikethrough", "autolink", "table"]
They did put a little warning in github/jekyll-commonmark-ghpages saying that
The UNSAFE option is required for HTML rendering.
Not sure if they announced somewhere, but I only noticed it when my pages broken 🥲
Note that when running jekyll serve
locally, it may show the following warning:
CommonMark: UNSAFE is not a valid option
Which is fine, you can ignore it.
Hope this help.