@hyperbook/markdown 0.29.2 → 0.29.4

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.
package/dist/index.js CHANGED
@@ -65879,13 +65879,10 @@ var getHeadings = (root5) => {
65879
65879
 
65880
65880
  // src/rehypeTableOfContents.ts
65881
65881
  var rehypeTableOfContents_default = (ctx) => () => {
65882
- const showToc = ctx.navigation.current?.toc || true;
65882
+ const showToc = (ctx.config.toc ?? true) && (ctx.navigation.current?.toc ?? true);
65883
65883
  return (tree, file) => {
65884
65884
  const headings = file.data.headings || [];
65885
65885
  const originalChildren = tree.children;
65886
- if (!showToc) {
65887
- return;
65888
- }
65889
65886
  const tocSidebar = [
65890
65887
  {
65891
65888
  type: "element",
@@ -65993,7 +65990,7 @@ var rehypeTableOfContents_default = (ctx) => () => {
65993
65990
  properties: {
65994
65991
  class: "hyperbook-markdown"
65995
65992
  },
65996
- children: [...tocSidebar, ...originalChildren]
65993
+ children: [...showToc ? tocSidebar : [], ...originalChildren]
65997
65994
  }
65998
65995
  ];
65999
65996
  };
@@ -74934,7 +74931,7 @@ var remarkDirectivePagelist_default = (ctx) => () => {
74934
74931
 
74935
74932
  // src/rehypeQrCode.ts
74936
74933
  var rehypeQrCode_default = (ctx) => () => {
74937
- const qrcode = ctx.config.qrcode || ctx.navigation.current?.qrcode || true;
74934
+ const qrcode = ctx.config.qrcode && (ctx.navigation.current?.qrcode ?? true);
74938
74935
  return (tree, file) => {
74939
74936
  const originalChildren = tree.children;
74940
74937
  if (!qrcode || !ctx.navigation.current?.href) {