@hackersheet/next-document-content-components 0.1.0-alpha.8 → 0.1.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,5 +43,5 @@ function CodeBlockCopyButton({ code }) {
43
43
  setTimeout(() => setCopied(false), 1e3);
44
44
  });
45
45
  };
46
- return /* @__PURE__ */ import_react.default.createElement("button", { onClick: handleClick }, copied ? /* @__PURE__ */ import_react.default.createElement(import_hi2.HiCheck, { size: 18 }) : /* @__PURE__ */ import_react.default.createElement(import_hi2.HiOutlineClipboardDocumentList, { size: 18 }));
46
+ return /* @__PURE__ */ import_react.default.createElement("button", { onClick: handleClick, "aria-label": "Copy code to clipboard" }, copied ? /* @__PURE__ */ import_react.default.createElement(import_hi2.HiCheck, { size: 18 }) : /* @__PURE__ */ import_react.default.createElement(import_hi2.HiOutlineClipboardDocumentList, { size: 18 }));
47
47
  }
@@ -30,7 +30,7 @@ async function highlighteCode(code, language) {
30
30
  if (shikiLang === void 0 && language !== "text") {
31
31
  return null;
32
32
  }
33
- const html = highlighter.codeToHtml(code, {
33
+ const html = highlighter.codeToHtml(code.trim(), {
34
34
  lang: shikiLang || "text",
35
35
  themes: {
36
36
  light: "github-light",
@@ -10,7 +10,7 @@ function CodeBlockCopyButton({ code }) {
10
10
  setTimeout(() => setCopied(false), 1e3);
11
11
  });
12
12
  };
13
- return /* @__PURE__ */ React.createElement("button", { onClick: handleClick }, copied ? /* @__PURE__ */ React.createElement(HiCheck, { size: 18 }) : /* @__PURE__ */ React.createElement(HiOutlineClipboardDocumentList, { size: 18 }));
13
+ return /* @__PURE__ */ React.createElement("button", { onClick: handleClick, "aria-label": "Copy code to clipboard" }, copied ? /* @__PURE__ */ React.createElement(HiCheck, { size: 18 }) : /* @__PURE__ */ React.createElement(HiOutlineClipboardDocumentList, { size: 18 }));
14
14
  }
15
15
  export {
16
16
  CodeBlockCopyButton as default
@@ -12,7 +12,7 @@ async function highlighteCode(code, language) {
12
12
  if (shikiLang === void 0 && language !== "text") {
13
13
  return null;
14
14
  }
15
- const html = highlighter.codeToHtml(code, {
15
+ const html = highlighter.codeToHtml(code.trim(), {
16
16
  lang: shikiLang || "text",
17
17
  themes: {
18
18
  light: "github-light",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackersheet/next-document-content-components",
3
- "version": "0.1.0-alpha.8",
3
+ "version": "0.1.0-alpha.9",
4
4
  "description": "Hacker Sheet document content components for Next.js",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -31,8 +31,8 @@
31
31
  "react-icons": "^5.2.1",
32
32
  "react-tweet": "^3.2.1",
33
33
  "shiki": "^1.10.3",
34
- "@hackersheet/core": "0.1.0-alpha.4",
35
- "@hackersheet/react-document-content": "0.1.0-alpha.7"
34
+ "@hackersheet/core": "0.1.0-alpha.5",
35
+ "@hackersheet/react-document-content": "0.1.0-alpha.9"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/react": "^18.0.0",