@d10f/asciidoc-astro-loader 0.0.11 → 0.0.12

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.
@@ -61,6 +61,7 @@ var transformAsciidocCallout = (options) => {
61
61
  };
62
62
 
63
63
  // src/lib/shiki/transformers/transformerPrompt.ts
64
+ import "test";
64
65
  var transformerPrompt = (options) => {
65
66
  return (node) => {
66
67
  const language = node.getAttribute("language");
@@ -80,9 +81,16 @@ var transformerPrompt = (options) => {
80
81
  const skipCurrent = skipNext;
81
82
  skipNext = false;
82
83
  const lastChild = hast.children.at(-1);
83
- if (lastChild && // @ts-expect-error property "children" does exist
84
- lastChild.children[0].value.match(/\s+\\(?:\\)?\s*$/)) {
85
- skipNext = true;
84
+ if (lastChild) {
85
+ if (lastChild.children[0].value.match(/\s+\\(?:\\)?\s*$/)) {
86
+ skipNext = true;
87
+ } else if (
88
+ // @ts-expect-error property "children" does exist
89
+ lastChild.children[0].value.match(/\s+\\n\s*$/)
90
+ ) {
91
+ skipNext = true;
92
+ lastChild.children[0].value = "";
93
+ }
86
94
  }
87
95
  if (skipCurrent) return;
88
96
  hast.children.unshift({
package/dist/index.cjs CHANGED
@@ -785,6 +785,7 @@ async function setDocument(doc, converters, templateEngine, { parseData, store }
785
785
  }
786
786
 
787
787
  // src/lib/shiki/transformers/transformerPrompt.ts
788
+ var import_node_test = require("test");
788
789
  var transformerPrompt = (options) => {
789
790
  return (node) => {
790
791
  const language = node.getAttribute("language");
@@ -804,9 +805,16 @@ var transformerPrompt = (options) => {
804
805
  const skipCurrent = skipNext;
805
806
  skipNext = false;
806
807
  const lastChild = hast.children.at(-1);
807
- if (lastChild && // @ts-expect-error property "children" does exist
808
- lastChild.children[0].value.match(/\s+\\(?:\\)?\s*$/)) {
809
- skipNext = true;
808
+ if (lastChild) {
809
+ if (lastChild.children[0].value.match(/\s+\\(?:\\)?\s*$/)) {
810
+ skipNext = true;
811
+ } else if (
812
+ // @ts-expect-error property "children" does exist
813
+ lastChild.children[0].value.match(/\s+\\n\s*$/)
814
+ ) {
815
+ skipNext = true;
816
+ lastChild.children[0].value = "";
817
+ }
810
818
  }
811
819
  if (skipCurrent) return;
812
820
  hast.children.unshift({
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  transformAsciidocCallout,
6
6
  transformerPrompt
7
- } from "./chunk-KPEWXJBE.js";
7
+ } from "./chunk-AZCYI3XV.js";
8
8
  import {
9
9
  slugify,
10
10
  splitFilenameComponents
@@ -90,6 +90,7 @@ var transformAsciidocCallout = (options) => {
90
90
  };
91
91
 
92
92
  // src/lib/shiki/transformers/transformerPrompt.ts
93
+ var import_node_test = require("test");
93
94
  var transformerPrompt = (options) => {
94
95
  return (node) => {
95
96
  const language = node.getAttribute("language");
@@ -109,9 +110,16 @@ var transformerPrompt = (options) => {
109
110
  const skipCurrent = skipNext;
110
111
  skipNext = false;
111
112
  const lastChild = hast.children.at(-1);
112
- if (lastChild && // @ts-expect-error property "children" does exist
113
- lastChild.children[0].value.match(/\s+\\(?:\\)?\s*$/)) {
114
- skipNext = true;
113
+ if (lastChild) {
114
+ if (lastChild.children[0].value.match(/\s+\\(?:\\)?\s*$/)) {
115
+ skipNext = true;
116
+ } else if (
117
+ // @ts-expect-error property "children" does exist
118
+ lastChild.children[0].value.match(/\s+\\n\s*$/)
119
+ ) {
120
+ skipNext = true;
121
+ lastChild.children[0].value = "";
122
+ }
115
123
  }
116
124
  if (skipCurrent) return;
117
125
  hast.children.unshift({
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  transformAsciidocCallout,
3
3
  transformerPrompt
4
- } from "../../../chunk-KPEWXJBE.js";
4
+ } from "../../../chunk-AZCYI3XV.js";
5
5
  import "../../../chunk-2UGTFP4R.js";
6
6
  export {
7
7
  transformAsciidocCallout,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d10f/asciidoc-astro-loader",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "An Astro collections loader for Asciidoc files",
5
5
  "author": "D10f",
6
6
  "license": "MIT",