spec-up-t 1.1.40 → 1.1.41
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/assets/js/adjust-font-size.js +1 -1
- package/package.json +1 -1
- package/src/prepare-tref.js +9 -12
|
@@ -31,7 +31,7 @@ function adjustFontSize() {
|
|
|
31
31
|
// Add event listeners to buttons
|
|
32
32
|
document.getElementById('decreaseBtn').addEventListener('click', () => adjust(-2));
|
|
33
33
|
document.getElementById('increaseBtn').addEventListener('click', () => adjust(2));
|
|
34
|
-
document.getElementById('resetBtn').addEventListener('click', reset);
|
|
34
|
+
// document.getElementById('resetBtn').addEventListener('click', reset);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
document.addEventListener("DOMContentLoaded", function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-up-t",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.41",
|
|
4
4
|
"description": "Technical specification drafting tool that generates rich specification documents from markdown. Forked from https://github.com/decentralized-identity/spec-up by Daniel Buchner (https://github.com/csuwildcat)",
|
|
5
5
|
"main": "./index",
|
|
6
6
|
"repository": {
|
package/src/prepare-tref.js
CHANGED
|
@@ -66,20 +66,16 @@ function prepareTref(directory) {
|
|
|
66
66
|
// Split the content into lines
|
|
67
67
|
let lines = data.split('\n');
|
|
68
68
|
|
|
69
|
+
// Variable to store content after the span
|
|
70
|
+
let contentAfterSpan = '';
|
|
71
|
+
const spanMarker = '<span style="display: none;">End of included external content. Add your optional custom content below.</span>';
|
|
72
|
+
const spanIndex = data.indexOf(spanMarker);
|
|
73
|
+
if (spanIndex !== -1) {
|
|
74
|
+
contentAfterSpan = data.substring(spanIndex + spanMarker.length);
|
|
75
|
+
}
|
|
76
|
+
|
|
69
77
|
for (let i = 0; i < lines.length; i++) {
|
|
70
78
|
if (lines[i].startsWith('[[tref:')) {
|
|
71
|
-
|
|
72
|
-
/*
|
|
73
|
-
\[\[tref: matches the literal [[tref:.
|
|
74
|
-
|
|
75
|
-
(.*?) captures everything lazily until the next part of the regex.
|
|
76
|
-
|
|
77
|
-
\]\] matches the literal ]].
|
|
78
|
-
|
|
79
|
-
match[1] contains the captured group, which is then split by , to form an array.
|
|
80
|
-
|
|
81
|
-
The map function trims spaces from each entry in the resulting array.
|
|
82
|
-
*/
|
|
83
79
|
const tref = /\[\[tref:(.*?)\]\]/;
|
|
84
80
|
const match = lines[i].match(tref);
|
|
85
81
|
if (match) {
|
|
@@ -98,6 +94,7 @@ ${match[0]}
|
|
|
98
94
|
| Commit hash | ${localXTrefContent.commitHash} |
|
|
99
95
|
|
|
100
96
|
${localXTrefContent.content}
|
|
97
|
+
${spanMarker}${contentAfterSpan}
|
|
101
98
|
`;
|
|
102
99
|
|
|
103
100
|
fs.writeFileSync(itemPath, readyForWrite, 'utf8');
|