hexo-include-markdown
hexo-include-markdown copied to clipboard
Render differences with codeblock
I am using hexo-include-markdown v1.0.2 & hexo v5.4.0 and I noticed that code blocks behave differently. When writing them directly in my main Markdown file, the code line numbers render fine but if I use the Markdown include they are distorted.
Here is an example to test:
include.md
{% codeblock lang:ts %}
export const sendRequestWithCookie = async (
client: HttpClient,
config: AxiosRequestConfig,
engine: CRUDEngine
): AxiosPromise => {
const cookie: Cookie = await loadExistingCookie(engine);
if (!cookie.isExpired) {
config.headers = config.headers || {};
config.headers['Cookie'] = `zuid=${cookie.zuid}`;
config.withCredentials = true;
}
return client._sendRequest(config);
};
{% endcodeblock %}
Try to use it in index.md with:
---
title: Test
---
## Test
<!-- include.md -->
Plugin version(npm ls --depth 0)
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- UNMET DEPENDENCY [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]
Screenshot

After debugging further I noticed that this error also happens with simple code like this:
console.log('Hello, World!');
I have the assumption that highlight.js kicks in too late when files are included with "hexo-include-markdown".
Because codeblocks are not working with "hexo-include-markdown", I created my own plugin which supports it:
- https://github.com/bennycode/hexo-insert-markdown