Skip to content

Render differences with codeblock #7

Description

@bennycode

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)

+-- hexo-browsersync@0.3.0
+-- hexo-clean-css@1.0.0
+-- hexo-filter-nofollow@2.0.2
+-- hexo-generator-archive@1.0.0
+-- hexo-generator-category@1.0.0
+-- hexo-generator-feed@3.0.0
+-- hexo-generator-index@2.0.0
+-- hexo-generator-sitemap@2.1.0
+-- hexo-generator-tag@1.0.0
+-- hexo-include-markdown@1.0.2
+-- hexo-renderer-ejs@1.0.0
+-- hexo-renderer-marked@4.0.0
+-- hexo-renderer-sass@0.4.0
+-- UNMET DEPENDENCY hexo-renderer-scss@1.2.0
+-- hexo-renderer-stylus@2.0.1
+-- hexo-server@2.0.0
+-- hexo@5.4.0
+-- highlight.js@10.7.2
+-- normalize.css@8.0.1
`-- prettier@2.3.0

Screenshot

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions