@hyperbook/markdown 0.24.9 → 0.24.11

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
@@ -63885,6 +63885,9 @@ var remarkDirectiveSqlIde_default = (ctx) => () => {
63885
63885
 
63886
63886
  // locales/en.json
63887
63887
  var en_default = {
63888
+ "footnote-label": "Footnotes",
63889
+ "footnote-back-label": "Back to reference {{index}}",
63890
+ "footnote-back-label-many": "Back to reference {{from}}-{{to}}",
63888
63891
  "store-different-origin": "The Hyperbook file is from a different origin {{origin}}. Do you want to import it anyways?",
63889
63892
  "store-import-successful": "The Hyperbook file has been imported successfully.",
63890
63893
  "store-not-supported-file-version": "The Hyperbook file has an unsupported version {{version}}.",
@@ -63935,6 +63938,9 @@ var en_default = {
63935
63938
 
63936
63939
  // locales/de.json
63937
63940
  var de_default = {
63941
+ "footnote-label": "Fu\xDFnoten",
63942
+ "footnote-back-label": "Hochspringen nach: {{index}}",
63943
+ "footnote-back-label-many": "Hochspringen nach: {{from}}-{{to}}",
63938
63944
  "store-different-origin": "Die Hyperbook-Datei stammt aus einer anderen Quelle {{origin}}. M\xF6chten Sie sie trotzdem importieren?",
63939
63945
  "store-import-successful": "Die Hyperbook-Datei wurde erfolgreich importiert.",
63940
63946
  "store-not-supported-file-version": "Die Hyperbook-Datei hat eine nicht unterst\xFCtzte Version {{version}}.",
@@ -66692,7 +66698,7 @@ var remarkDirectiveCollapsible_default = (ctx) => () => {
66692
66698
  });
66693
66699
  for (const node3 of collapsibleNodes) {
66694
66700
  const data = node3.data || (node3.data = {});
66695
- const { title = "", id } = node3.data.hProperties || {};
66701
+ const { title = "", id = hash(node3) } = node3.data.hProperties || {};
66696
66702
  expectContainerDirective(node3, file, name);
66697
66703
  registerDirective(file, name, [], ["style.css"]);
66698
66704
  node3.attributes = {};
@@ -74158,6 +74164,7 @@ html, body {
74158
74164
 
74159
74165
  // src/process.ts
74160
74166
  var remark = (ctx) => {
74167
+ i18n.init(ctx.config.language || "en");
74161
74168
  const remarkPlugins = [
74162
74169
  remarkRemoveComments,
74163
74170
  remarkGemoji,
@@ -74202,7 +74209,19 @@ var remark = (ctx) => {
74202
74209
  remarkCollectSearchDocuments_default(ctx)
74203
74210
  ];
74204
74211
  return unified().use(remarkParse).use(remarkPlugins).use(remarkRehype, {
74205
- allowDangerousHtml: ctx.config.allowDangerousHtml || false
74212
+ allowDangerousHtml: ctx.config.allowDangerousHtml || false,
74213
+ footnoteLabel: i18n.get("footnote-label"),
74214
+ footnoteBackLabel(referenceIndex, rereferenceIndex) {
74215
+ if (rereferenceIndex > 1) {
74216
+ return i18n.get("footnote-back-label-many", {
74217
+ index: `${referenceIndex + 1}`
74218
+ });
74219
+ }
74220
+ return i18n.get("footnote-back-label-many", {
74221
+ from: `${referenceIndex + 1}`,
74222
+ to: `${rereferenceIndex}`
74223
+ });
74224
+ }
74206
74225
  });
74207
74226
  };
74208
74227
  var process2 = (md, ctx) => {