spec-up-t 1.1.40 → 1.1.42

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.
@@ -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.40",
3
+ "version": "1.1.42",
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": {
@@ -66,20 +66,30 @@ 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 or tref line
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
+
74
+ if (spanIndex !== -1) {
75
+ // If span marker exists, take content after it
76
+ contentAfterSpan = data.substring(spanIndex + spanMarker.length);
77
+ } else {
78
+ // If span marker doesn't exist, find the tref line and keep everything after it
79
+ let trefLineIndex = -1;
80
+ for (let i = 0; i < lines.length; i++) {
81
+ if (lines[i].startsWith('[[tref:')) {
82
+ trefLineIndex = i;
83
+ break;
84
+ }
85
+ }
86
+ if (trefLineIndex !== -1 && trefLineIndex < lines.length - 1) {
87
+ contentAfterSpan = lines.slice(trefLineIndex + 1).join('\n');
88
+ }
89
+ }
90
+
69
91
  for (let i = 0; i < lines.length; i++) {
70
92
  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
93
  const tref = /\[\[tref:(.*?)\]\]/;
84
94
  const match = lines[i].match(tref);
85
95
  if (match) {
@@ -98,6 +108,10 @@ ${match[0]}
98
108
  | Commit hash | ${localXTrefContent.commitHash} |
99
109
 
100
110
  ${localXTrefContent.content}
111
+ ${spanMarker}
112
+
113
+ ${contentAfterSpan}
114
+
101
115
  `;
102
116
 
103
117
  fs.writeFileSync(itemPath, readyForWrite, 'utf8');