@udx/md2html 1.4.0 → 1.4.2

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/index.js CHANGED
@@ -289,11 +289,13 @@ async function buildHtml(srcDir, outputFile) {
289
289
  }
290
290
 
291
291
  // Process all mathematical formulas in the content (before image processing)
292
- // This pattern matches: $formula$ for inline math
293
- const inlineMathPattern = /\$(.*?)\$/g;
292
+ // This pattern matches: $formula$ for inline math, but NOT across newlines or table cells
293
+ // The [^\n$|] ensures we don't match across lines, other dollar signs, or table cell separators
294
+ const inlineMathPattern = /\$([^\n$|]+?)\$/g;
294
295
  combinedMarkdown = combinedMarkdown.replace(inlineMathPattern, (match, formula) => {
295
- // Skip if it's likely a currency symbol
296
- if (/^\s*\d+(\.\d+)?\s*$/.test(formula)) {
296
+ // Skip if it's likely a currency value (numbers with optional commas, decimals, K/M suffixes)
297
+ // Also skip if it starts with a number (likely currency like $22,945)
298
+ if (/^\s*[\d,]+(\.\d+)?[KMB]?\s*$/.test(formula) || /^\d/.test(formula.trim())) {
297
299
  return match;
298
300
  }
299
301
  return `\\(${formula}\\)`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@udx/md2html",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Magazine-quality Markdown to HTML converter with professional styling",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,10 +1,11 @@
1
1
  /* Chapter Navigation Styles */
2
2
  :root {
3
- --chapter-nav-width: 220px;
3
+ --chapter-nav-width: 264px;
4
4
  --chapter-nav-text-color: #1a1a1a;
5
5
  --chapter-nav-text-faded: rgba(51, 51, 51, 0.65);
6
6
  --chapter-nav-active-color: #991b1b;
7
7
  --chapter-text-size: 0.85rem;
8
+ --content-gap: 80px;
8
9
  }
9
10
 
10
11
  /* Container for the floating navigation */
@@ -190,13 +191,15 @@
190
191
  }
191
192
 
192
193
  /* Add padding to the content to prevent floating nav from overlapping */
193
- /* Content is centered in the remaining space to the right of the sidebar */
194
+ /* Content fills the space to the right of the sidebar, article centers within it */
194
195
  .chapter-content {
195
- /* Leave space for sidebar on the left - push content further right */
196
- margin-left: calc(var(--chapter-nav-width) + 120px);
197
- /* Add margin on the right for balance */
198
- margin-right: 80px;
199
- /* Remove padding-left since we're using margin */
196
+ /* Position content to start right after the sidebar */
197
+ margin-left: var(--chapter-nav-width);
198
+ margin-right: 0;
199
+ /* Override Tailwind container max-width so content fills available space */
200
+ max-width: none !important;
201
+ width: auto !important;
202
+ /* Remove horizontal padding - let the article's mx-auto handle centering */
200
203
  padding-left: 0;
201
204
  padding-right: 0;
202
205
  }
@@ -204,8 +207,8 @@
204
207
  /* Responsive adjustments */
205
208
  @media (max-width: 1024px) {
206
209
  .chapter-content {
207
- margin-left: calc(var(--chapter-nav-width) + 60px);
208
- margin-right: 40px;
210
+ margin-left: var(--chapter-nav-width);
211
+ margin-right: 0;
209
212
  }
210
213
  }
211
214
 
package/static/scripts.js CHANGED
@@ -63,30 +63,6 @@ document.addEventListener('DOMContentLoaded', (event) => {
63
63
  el.style.boxShadow = 'none';
64
64
  });
65
65
 
66
- // Format tabular data with scaling operations
67
- document.querySelectorAll('p').forEach(p => {
68
- const text = p.textContent.trim();
69
- if (text.includes('IT/SRE for every') || text.includes('DevOps Engineer for every')) {
70
- // Find the paragraph containing the scaling information
71
- const container = document.createElement('div');
72
- container.className = 'scaling-table';
73
-
74
- // Parse the content and create a grid layout
75
- const content = p.textContent.trim();
76
- const parts = content.split(',').map(part => part.trim());
77
-
78
- parts.forEach(part => {
79
- const itemDiv = document.createElement('div');
80
- itemDiv.textContent = part;
81
- itemDiv.className = 'scaling-item';
82
- container.appendChild(itemDiv);
83
- });
84
-
85
- // Replace the paragraph with the grid container
86
- p.parentNode.replaceChild(container, p);
87
- }
88
- });
89
-
90
66
  // Process quote attributions with em dash
91
67
  document.querySelectorAll('blockquote + p').forEach(p => {
92
68
  const text = p.textContent || '';
package/static/styles.css CHANGED
@@ -57,10 +57,10 @@ body {
57
57
 
58
58
  .content-container {
59
59
  width: 100%;
60
- max-width: 768px;
60
+ max-width: 800px;
61
61
  margin: 0 auto;
62
62
  padding: 2rem;
63
- font-size: 18px !important;
63
+ font-size: 20px !important;
64
64
  /* Magazine-style container */
65
65
  }
66
66
 
@@ -73,7 +73,7 @@ html:not(:has(details[open])) {
73
73
  .prose p {
74
74
  margin-top: 0 !important;
75
75
  margin-bottom: 0 !important;
76
- font-size: 18px !important;
76
+ font-size: 20px !important;
77
77
  line-height: 1.6 !important;
78
78
  }
79
79
 
@@ -98,7 +98,7 @@ html:not(:has(details[open])) {
98
98
  }
99
99
 
100
100
  .prose li {
101
- font-size: 18px !important;
101
+ font-size: 20px !important;
102
102
  margin-bottom: 0.5em !important;
103
103
  line-height: 1.6 !important;
104
104
  position: relative !important;
@@ -3,8 +3,8 @@
3
3
 
4
4
  body {
5
5
  font-family: "Times New Roman", Times, Georgia, serif;
6
- font-size: 12pt;
7
- line-height: 1.5;
6
+ font-size: 11pt;
7
+ line-height: 1.4;
8
8
  }
9
9
 
10
10
  .content-container {
@@ -12,55 +12,62 @@ body {
12
12
  padding: 1in;
13
13
  }
14
14
 
15
+ @media print {
16
+ .content-container {
17
+ padding: 1.25in !important;
18
+ max-width: 6in !important;
19
+ }
20
+ }
21
+
15
22
  /* Formal heading styles */
16
23
  .prose h1, h1 {
17
- font-size: 18pt !important;
24
+ font-size: 16pt !important;
18
25
  font-weight: bold !important;
19
26
  text-align: center !important;
20
- margin-bottom: 24pt !important;
27
+ margin-bottom: 20pt !important;
21
28
  font-family: "Times New Roman", Times, Georgia, serif !important;
22
29
  }
23
30
 
24
31
  .prose h2, h2 {
25
- font-size: 14pt !important;
32
+ font-size: 13pt !important;
26
33
  font-weight: bold !important;
27
- margin-top: 18pt !important;
28
- margin-bottom: 12pt !important;
34
+ margin-top: 16pt !important;
35
+ margin-bottom: 10pt !important;
29
36
  font-family: "Times New Roman", Times, Georgia, serif !important;
30
37
  }
31
38
 
32
39
  .prose h3, h3 {
33
- font-size: 12pt !important;
40
+ font-size: 11pt !important;
34
41
  font-weight: bold !important;
35
- margin-top: 12pt !important;
42
+ margin-top: 10pt !important;
36
43
  margin-bottom: 6pt !important;
37
44
  font-family: "Times New Roman", Times, Georgia, serif !important;
38
45
  }
39
46
 
40
47
  .prose h4, h4, .prose h5, h5, .prose h6, h6 {
41
- font-size: 12pt !important;
48
+ font-size: 11pt !important;
42
49
  font-weight: bold !important;
43
50
  font-style: italic !important;
44
- margin-top: 12pt !important;
45
- margin-bottom: 6pt !important;
51
+ margin-top: 10pt !important;
52
+ margin-bottom: 5pt !important;
46
53
  font-family: "Times New Roman", Times, Georgia, serif !important;
47
54
  }
48
55
 
49
56
  .prose p, p {
50
- font-size: 12pt !important;
57
+ font-size: 11pt !important;
51
58
  text-align: justify !important;
52
- margin-bottom: 12pt !important;
59
+ margin-bottom: 10pt !important;
53
60
  font-family: "Times New Roman", Times, Georgia, serif !important;
54
61
  }
55
62
 
56
63
  .prose li {
57
- font-size: 12pt !important;
64
+ font-size: 11pt !important;
58
65
  font-family: "Times New Roman", Times, Georgia, serif !important;
59
66
  }
60
67
 
61
68
  /* Table styling for government documents */
62
69
  .prose table {
63
- font-size: 10pt !important;
70
+ font-size: 9pt !important;
64
71
  border-collapse: collapse !important;
65
72
  }
66
73
 
@@ -121,7 +128,9 @@ figure img {
121
128
  /* Print-optimized styling */
122
129
  @media print {
123
130
  body {
124
- font-size: 12pt !important;
131
+ font-size: 11pt !important;
132
+ margin: 0 !important;
133
+ padding: 0 !important;
125
134
  }
126
135
 
127
136
  .chapter-navigation, .mobile-chapter-nav {
@@ -130,5 +139,11 @@ figure img {
130
139
 
131
140
  .chapter-content {
132
141
  padding-left: 0 !important;
142
+ margin: 0 !important;
143
+ }
144
+
145
+ /* Ensure no content bleeds to edges */
146
+ * {
147
+ box-sizing: border-box !important;
133
148
  }
134
149
  }