commit c55ae8b2eac3e614d2427aa0a55e1035d3f920d7
parent 1d41ef3b7d8b7a12a33c0a4f48ac44d3748ad8fe
Author: typable <contact@typable.dev>
Date: Sun, 5 May 2024 13:54:19 +0200
fix: Fixed ref digit length bug
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib.js b/lib.js
@@ -165,7 +165,7 @@ export default function figure(create) {
slice += slices[i];
if (values[i] != null) {
// create unique reference
- const uid = `$fig-${count++}`;
+ const uid = `$fig-${count++}$`;
refs[uid] = values[i];
slice += uid ?? '';
}
@@ -181,7 +181,7 @@ export default function figure(create) {
* @returns {ReactElement[]} The string populated with the passed values
*/
function feed(slice, refs) {
- const expr = /\$fig-\d+/g;
+ const expr = /\$fig-\d+\$/g;
const elements = /** @type {ReactElement[]} */ ([]);
let match = null;
let last = 0;