legal-markdown-js 2.6.3 â 2.7.0
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/dist/web/index.html +490 -13
- package/package.json +2 -2
package/dist/web/index.html
CHANGED
|
@@ -72,6 +72,7 @@ Your content with {{variable}} substitutions..."></textarea>
|
|
|
72
72
|
<div class="example-dropdown">
|
|
73
73
|
<select class="css-example-select">
|
|
74
74
|
<option value="">đ¨ CSS Examples</option>
|
|
75
|
+
<option value="default">Default Legal Styles</option>
|
|
75
76
|
<option value="modern">Modern Style</option>
|
|
76
77
|
<option value="classic">Classic Legal</option>
|
|
77
78
|
<option value="minimal">Minimal</option>
|
|
@@ -176,7 +177,7 @@ p {
|
|
|
176
177
|
</span>
|
|
177
178
|
</label>
|
|
178
179
|
<label class="checkbox-item">
|
|
179
|
-
<input type="checkbox" id="enableFieldTracking"> Field tracking
|
|
180
|
+
<input type="checkbox" id="enableFieldTracking" checked> Field tracking
|
|
180
181
|
<span class="tooltip">
|
|
181
182
|
<span class="tooltip-icon">âšī¸</span>
|
|
182
183
|
<span class="tooltip-text">Adds HTML spans around template variables and headers for debugging and styling. When disabled, maintains compatibility with Ruby version.</span>
|
|
@@ -273,6 +274,7 @@ p {
|
|
|
273
274
|
<div id="messageArea"></div>
|
|
274
275
|
</div>
|
|
275
276
|
|
|
277
|
+
<script src="https://cdn.jsdelivr.net/npm/marked@16.1.1/marked.min.js"></script>
|
|
276
278
|
<script src="./legal-markdown.umd.min.js"></script>
|
|
277
279
|
<script>
|
|
278
280
|
class LegalMarkdownApp {
|
|
@@ -288,6 +290,7 @@ p {
|
|
|
288
290
|
this.initializePreviewResizer();
|
|
289
291
|
this.updateBaseStyles(); // Initialize base styles
|
|
290
292
|
this.loadExample('service-agreement');
|
|
293
|
+
this.loadCSSExample('default'); // Load default CSS by default
|
|
291
294
|
}
|
|
292
295
|
|
|
293
296
|
initializeTheme() {
|
|
@@ -485,19 +488,28 @@ p {
|
|
|
485
488
|
}
|
|
486
489
|
|
|
487
490
|
formatMarkdownForDisplay(content) {
|
|
488
|
-
//
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
.
|
|
492
|
-
.
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
.
|
|
498
|
-
|
|
491
|
+
// IMPORTANT: This content has already been processed by our Legal Markdown pipeline
|
|
492
|
+
// in processContent(). Here we just need to convert the final markdown to HTML.
|
|
493
|
+
if (typeof marked === 'undefined') {
|
|
494
|
+
console.error('Marked library is not available. Ensure it is loaded correctly.');
|
|
495
|
+
return `<p>Error: Markdown parser unavailable. Please check your setup.</p>
|
|
496
|
+
<pre>${this.escapeHtml(content)}</pre>`;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
try {
|
|
500
|
+
return marked.parse(content, {
|
|
501
|
+
breaks: true,
|
|
502
|
+
gfm: true
|
|
503
|
+
});
|
|
504
|
+
} catch (error) {
|
|
505
|
+
console.error('Markdown parsing failed:', error);
|
|
506
|
+
return `<p>Error: Failed to process Markdown content.</p>
|
|
507
|
+
<pre>${this.escapeHtml(content)}</pre>`;
|
|
508
|
+
}
|
|
499
509
|
}
|
|
500
510
|
|
|
511
|
+
|
|
512
|
+
|
|
501
513
|
downloadDocument() {
|
|
502
514
|
if (!this.processedResult) {
|
|
503
515
|
this.showMessage('Please process a document first.', 'error');
|
|
@@ -1357,7 +1369,7 @@ Signature: ___________________________ Date: ___________`
|
|
|
1357
1369
|
stats.push(`${yamlKeys} YAML variables`);
|
|
1358
1370
|
}
|
|
1359
1371
|
|
|
1360
|
-
if (result.fieldReport) {
|
|
1372
|
+
if (result.fieldReport && Array.isArray(result.fieldReport)) {
|
|
1361
1373
|
stats.push(`${result.fieldReport.length} field substitutions`);
|
|
1362
1374
|
}
|
|
1363
1375
|
|
|
@@ -1585,6 +1597,471 @@ Your content with {{variable}} substitutions...
|
|
|
1585
1597
|
|
|
1586
1598
|
getCSSExamples() {
|
|
1587
1599
|
return {
|
|
1600
|
+
'default': `/**
|
|
1601
|
+
* Default Legal Markdown Styles
|
|
1602
|
+
*
|
|
1603
|
+
* Professional stylesheet for legal documents, optimized for both screen and print media.
|
|
1604
|
+
* Features modern typography, clean design, and comprehensive print optimizations.
|
|
1605
|
+
*/
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* Default Legal Markdown Styles
|
|
1609
|
+
*
|
|
1610
|
+
* Professional stylesheet for legal documents, optimized for both screen and print media.
|
|
1611
|
+
* Features modern typography, clean design, and comprehensive print optimizations.
|
|
1612
|
+
*
|
|
1613
|
+
* Structure:
|
|
1614
|
+
* 1. Variables and base configuration
|
|
1615
|
+
* 2. Typography and visual hierarchy
|
|
1616
|
+
* 3. Content elements
|
|
1617
|
+
* 4. Tables and signatures
|
|
1618
|
+
* 5. Print optimizations
|
|
1619
|
+
* 6. Utilities and special classes
|
|
1620
|
+
*/
|
|
1621
|
+
|
|
1622
|
+
/* Variables and base configuration
|
|
1623
|
+
========================================================================== */
|
|
1624
|
+
:root {
|
|
1625
|
+
/* Colors - Professional slate and teal palette */
|
|
1626
|
+
--color-primary: #1e293b; /* Slate 800 */
|
|
1627
|
+
--color-accent: #0891b2; /* Cyan 600 */
|
|
1628
|
+
--color-link: #0891b2; /* Cyan 600 */
|
|
1629
|
+
--color-text: #334155; /* Slate 700 */
|
|
1630
|
+
--color-error: #dc2626; /* Red 600 */
|
|
1631
|
+
--color-bg: #ffffff; /* White */
|
|
1632
|
+
--color-muted: #64748b; /* Slate 500 */
|
|
1633
|
+
|
|
1634
|
+
/* Typography */
|
|
1635
|
+
--font-primary: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
1636
|
+
--font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Courier New', monospace;
|
|
1637
|
+
|
|
1638
|
+
/* Assets - Default logo placeholder */
|
|
1639
|
+
--logo-filename: https://placehold.co/120x40/2563eb/ffffff.png?text=LOGO;
|
|
1640
|
+
|
|
1641
|
+
/* Spacing */
|
|
1642
|
+
--spacing-xsmall: 4px;
|
|
1643
|
+
--spacing-small: 8px;
|
|
1644
|
+
--spacing-medium: 16px;
|
|
1645
|
+
--spacing-large: 32px;
|
|
1646
|
+
--spacing-xlarge: 48px;
|
|
1647
|
+
|
|
1648
|
+
/* Sizes */
|
|
1649
|
+
--font-size-base: 12pt;
|
|
1650
|
+
--font-size-h1: 1.8em;
|
|
1651
|
+
--font-size-h2: 1.4em;
|
|
1652
|
+
--font-size-h3: 1.2em;
|
|
1653
|
+
--font-size-h4: 1.1em;
|
|
1654
|
+
|
|
1655
|
+
/* Layout */
|
|
1656
|
+
--max-width: 210mm; /* A4 width */
|
|
1657
|
+
--border-radius: 6px;
|
|
1658
|
+
--border-width: 1px;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
/* Base document configuration
|
|
1662
|
+
========================================================================== */
|
|
1663
|
+
body {
|
|
1664
|
+
font-family: var(--font-primary);
|
|
1665
|
+
font-size: var(--font-size-base);
|
|
1666
|
+
line-height: 1.6;
|
|
1667
|
+
color: var(--color-text);
|
|
1668
|
+
max-width: var(--max-width);
|
|
1669
|
+
margin: 0 auto;
|
|
1670
|
+
padding: 20mm 15mm;
|
|
1671
|
+
background-color: var(--color-bg);
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
/* Typography hierarchy
|
|
1675
|
+
========================================================================== */
|
|
1676
|
+
/* Prevent page breaks in headings */
|
|
1677
|
+
h1,
|
|
1678
|
+
h2,
|
|
1679
|
+
h3,
|
|
1680
|
+
h4,
|
|
1681
|
+
h5,
|
|
1682
|
+
h6 {
|
|
1683
|
+
page-break-after: avoid;
|
|
1684
|
+
page-break-inside: avoid;
|
|
1685
|
+
color: var(--color-primary);
|
|
1686
|
+
font-weight: 600;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
/* Main document title */
|
|
1690
|
+
h1,
|
|
1691
|
+
.legal-header-level-1 {
|
|
1692
|
+
font-size: var(--font-size-h1);
|
|
1693
|
+
line-height: 1.3;
|
|
1694
|
+
margin: var(--spacing-medium) 0 var(--spacing-large);
|
|
1695
|
+
text-align: center;
|
|
1696
|
+
border-bottom: 3px solid var(--color-accent);
|
|
1697
|
+
padding-bottom: var(--spacing-medium);
|
|
1698
|
+
color: var(--color-primary);
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
/* Section headings */
|
|
1702
|
+
h2,
|
|
1703
|
+
.legal-header-level-2 {
|
|
1704
|
+
font-size: var(--font-size-h2);
|
|
1705
|
+
margin-top: var(--spacing-large);
|
|
1706
|
+
margin-bottom: var(--spacing-medium);
|
|
1707
|
+
border-bottom: 2px solid var(--color-accent);
|
|
1708
|
+
padding-bottom: var(--spacing-small);
|
|
1709
|
+
color: var(--color-primary);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/* Subsection headings */
|
|
1713
|
+
h3,
|
|
1714
|
+
.legal-header-level-3 {
|
|
1715
|
+
font-size: var(--font-size-h3);
|
|
1716
|
+
font-weight: 600;
|
|
1717
|
+
margin-top: var(--spacing-large);
|
|
1718
|
+
margin-bottom: var(--spacing-medium);
|
|
1719
|
+
border-bottom: 1px solid var(--color-accent);
|
|
1720
|
+
padding-bottom: var(--spacing-xsmall);
|
|
1721
|
+
color: var(--color-primary);
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
/* Minor headings */
|
|
1725
|
+
h4,
|
|
1726
|
+
.legal-header-level-4 {
|
|
1727
|
+
font-size: var(--font-size-h4);
|
|
1728
|
+
font-weight: 600;
|
|
1729
|
+
margin-top: var(--spacing-medium);
|
|
1730
|
+
margin-bottom: var(--spacing-small);
|
|
1731
|
+
color: var(--color-primary);
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
/* Legal headers */
|
|
1735
|
+
h5,
|
|
1736
|
+
h6,
|
|
1737
|
+
.legal-header-level-5,
|
|
1738
|
+
.legal-header-level-6 {
|
|
1739
|
+
font-size: 1em;
|
|
1740
|
+
font-weight: 600;
|
|
1741
|
+
margin-top: var(--spacing-medium);
|
|
1742
|
+
margin-bottom: var(--spacing-small);
|
|
1743
|
+
color: var(--color-primary);
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
/* Content elements
|
|
1747
|
+
========================================================================== */
|
|
1748
|
+
/* Paragraphs */
|
|
1749
|
+
p {
|
|
1750
|
+
margin-bottom: var(--spacing-medium);
|
|
1751
|
+
text-align: justify;
|
|
1752
|
+
orphans: 3; /* Minimum lines at start of page */
|
|
1753
|
+
widows: 3; /* Minimum lines at end of page */
|
|
1754
|
+
page-break-inside: avoid;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
/* Links */
|
|
1758
|
+
a {
|
|
1759
|
+
color: var(--color-link);
|
|
1760
|
+
text-decoration: none;
|
|
1761
|
+
transition: color 0.2s ease;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
a:hover {
|
|
1765
|
+
text-decoration: underline;
|
|
1766
|
+
color: var(--color-accent);
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
/* Lists */
|
|
1770
|
+
ul,
|
|
1771
|
+
ol {
|
|
1772
|
+
margin: var(--spacing-medium) 0;
|
|
1773
|
+
padding-left: var(--spacing-large);
|
|
1774
|
+
page-break-inside: auto;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
li {
|
|
1778
|
+
margin-bottom: var(--spacing-small);
|
|
1779
|
+
page-break-inside: auto;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
/* Code blocks */
|
|
1783
|
+
pre {
|
|
1784
|
+
background-color: #f8fafc;
|
|
1785
|
+
border: var(--border-width) solid #e2e8f0;
|
|
1786
|
+
border-radius: var(--border-radius);
|
|
1787
|
+
padding: var(--spacing-medium);
|
|
1788
|
+
margin: var(--spacing-medium) 0;
|
|
1789
|
+
overflow-x: auto;
|
|
1790
|
+
font-family: var(--font-mono);
|
|
1791
|
+
font-size: 0.9em;
|
|
1792
|
+
line-height: 1.4;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
code {
|
|
1796
|
+
background-color: #f1f5f9;
|
|
1797
|
+
color: var(--color-primary);
|
|
1798
|
+
padding: var(--spacing-xsmall) var(--spacing-small);
|
|
1799
|
+
border-radius: 4px;
|
|
1800
|
+
font-family: var(--font-mono);
|
|
1801
|
+
font-size: 0.9em;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
/* Horizontal separators */
|
|
1805
|
+
hr {
|
|
1806
|
+
border: none;
|
|
1807
|
+
border-top: 2px solid var(--color-accent);
|
|
1808
|
+
margin: var(--spacing-large) 0;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
/* Empty fields and missing values */
|
|
1812
|
+
.missing-value {
|
|
1813
|
+
background-color: #fef2f2;
|
|
1814
|
+
color: var(--color-error);
|
|
1815
|
+
padding: var(--spacing-xsmall) var(--spacing-small);
|
|
1816
|
+
border-radius: 4px;
|
|
1817
|
+
border: var(--border-width) dashed var(--color-error);
|
|
1818
|
+
font-style: italic;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
/* Tables
|
|
1822
|
+
========================================================================== */
|
|
1823
|
+
.table-responsive {
|
|
1824
|
+
overflow-x: auto;
|
|
1825
|
+
-webkit-overflow-scrolling: touch;
|
|
1826
|
+
margin: var(--spacing-medium) 0;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
table {
|
|
1830
|
+
width: 100%;
|
|
1831
|
+
border-collapse: collapse;
|
|
1832
|
+
margin: var(--spacing-medium) 0;
|
|
1833
|
+
table-layout: fixed;
|
|
1834
|
+
background-color: var(--color-bg);
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
th,
|
|
1838
|
+
td {
|
|
1839
|
+
border: var(--border-width) solid #e2e8f0;
|
|
1840
|
+
padding: var(--spacing-small) var(--spacing-medium);
|
|
1841
|
+
text-align: left;
|
|
1842
|
+
vertical-align: top;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
th {
|
|
1846
|
+
background-color: #f8fafc;
|
|
1847
|
+
font-weight: 600;
|
|
1848
|
+
color: var(--color-primary);
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
/* Signature table
|
|
1852
|
+
========================================================================== */
|
|
1853
|
+
.signatures {
|
|
1854
|
+
page-break-inside: avoid;
|
|
1855
|
+
margin-top: var(--spacing-xlarge);
|
|
1856
|
+
border: none;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
.signatures th {
|
|
1860
|
+
display: none; /* Hide headers while maintaining structure */
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
.signatures th,
|
|
1864
|
+
.signatures td {
|
|
1865
|
+
padding: var(--spacing-medium);
|
|
1866
|
+
text-align: left;
|
|
1867
|
+
border: none;
|
|
1868
|
+
border-bottom: 2px solid var(--color-primary);
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
/* Two-column layout: 1/3 for labels, 2/3 for signatures */
|
|
1872
|
+
.signatures th:first-child,
|
|
1873
|
+
.signatures td:first-child {
|
|
1874
|
+
width: 33.33%;
|
|
1875
|
+
font-weight: 600;
|
|
1876
|
+
color: var(--color-primary);
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
.signatures th:last-child,
|
|
1880
|
+
.signatures td:last-child {
|
|
1881
|
+
width: 66.67%;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
.signatures td:last-child {
|
|
1885
|
+
height: 6em;
|
|
1886
|
+
vertical-align: bottom;
|
|
1887
|
+
font-weight: normal;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
/* Table of contents
|
|
1891
|
+
========================================================================== */
|
|
1892
|
+
.table-of-contents {
|
|
1893
|
+
background-color: #f8fafc;
|
|
1894
|
+
border: var(--border-width) solid #e2e8f0;
|
|
1895
|
+
border-radius: var(--border-radius);
|
|
1896
|
+
padding: var(--spacing-medium);
|
|
1897
|
+
margin: var(--spacing-large) 0;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
.table-of-contents li {
|
|
1901
|
+
margin-bottom: var(--spacing-small);
|
|
1902
|
+
list-style-type: none;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
/* Confidential section
|
|
1906
|
+
========================================================================== */
|
|
1907
|
+
.confidential {
|
|
1908
|
+
width: 100%;
|
|
1909
|
+
background-color: var(--color-accent) !important;
|
|
1910
|
+
color: white !important;
|
|
1911
|
+
font-weight: bold !important;
|
|
1912
|
+
text-align: center !important;
|
|
1913
|
+
padding: var(--spacing-medium) 0 !important;
|
|
1914
|
+
margin: var(--spacing-large) 0 !important;
|
|
1915
|
+
text-transform: uppercase !important;
|
|
1916
|
+
letter-spacing: 1px !important;
|
|
1917
|
+
display: block !important;
|
|
1918
|
+
border-radius: var(--border-radius) !important;
|
|
1919
|
+
-webkit-print-color-adjust: exact !important;
|
|
1920
|
+
print-color-adjust: exact !important;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
/* Separator section
|
|
1924
|
+
========================================================================== */
|
|
1925
|
+
.separator {
|
|
1926
|
+
width: 100%;
|
|
1927
|
+
background-color: var(--color-primary) !important;
|
|
1928
|
+
color: white !important;
|
|
1929
|
+
font-weight: bold !important;
|
|
1930
|
+
text-align: center !important;
|
|
1931
|
+
padding: var(--spacing-small) 0 !important;
|
|
1932
|
+
margin: var(--spacing-large) 0 var(--spacing-medium) !important;
|
|
1933
|
+
text-transform: uppercase !important;
|
|
1934
|
+
letter-spacing: 1px !important;
|
|
1935
|
+
display: block !important;
|
|
1936
|
+
border-radius: var(--border-radius) !important;
|
|
1937
|
+
-webkit-print-color-adjust: exact !important;
|
|
1938
|
+
print-color-adjust: exact !important;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
/* Algorithm blocks
|
|
1942
|
+
========================================================================== */
|
|
1943
|
+
.algorithm {
|
|
1944
|
+
background-color: #f8fafc;
|
|
1945
|
+
border: var(--border-width) solid #e2e8f0;
|
|
1946
|
+
border-left: 4px solid var(--color-accent);
|
|
1947
|
+
border-radius: var(--border-radius);
|
|
1948
|
+
padding: var(--spacing-medium);
|
|
1949
|
+
margin: var(--spacing-medium) 0;
|
|
1950
|
+
font-family: var(--font-mono);
|
|
1951
|
+
font-size: 0.9em;
|
|
1952
|
+
line-height: 1.4;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
.algorithm pre {
|
|
1956
|
+
margin: 0;
|
|
1957
|
+
white-space: pre-wrap;
|
|
1958
|
+
background: none;
|
|
1959
|
+
border: none;
|
|
1960
|
+
padding: 0;
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
/* Utilities
|
|
1964
|
+
========================================================================== */
|
|
1965
|
+
.no-break {
|
|
1966
|
+
page-break-inside: avoid !important;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
.page-break-before {
|
|
1970
|
+
page-break-before: always !important;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
.text-center {
|
|
1974
|
+
text-align: center !important;
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
.text-muted {
|
|
1978
|
+
color: var(--color-muted) !important;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
/* Print optimizations
|
|
1982
|
+
========================================================================== */
|
|
1983
|
+
@media print {
|
|
1984
|
+
/* Page setup */
|
|
1985
|
+
@page {
|
|
1986
|
+
size: A4;
|
|
1987
|
+
margin: 20mm 15mm 15mm 15mm;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
body {
|
|
1991
|
+
font-size: 11pt;
|
|
1992
|
+
color: black;
|
|
1993
|
+
max-width: 100%;
|
|
1994
|
+
margin: 0;
|
|
1995
|
+
padding: 0;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
/* Links */
|
|
1999
|
+
a {
|
|
2000
|
+
text-decoration: none;
|
|
2001
|
+
color: var(--color-link);
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
/* Internal links */
|
|
2005
|
+
a[href^='#'] {
|
|
2006
|
+
color: var(--color-link);
|
|
2007
|
+
text-decoration: none;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
a[data-internal-link='true'] {
|
|
2011
|
+
color: var(--color-link) !important;
|
|
2012
|
+
text-decoration: none !important;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
/* Show URLs after external links */
|
|
2016
|
+
a[href^='http']:after {
|
|
2017
|
+
content: ' (' attr(href) ')';
|
|
2018
|
+
font-size: 90%;
|
|
2019
|
+
color: var(--color-muted);
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
/* Page break control */
|
|
2023
|
+
h1, h2, h3, h4, h5, h6 {
|
|
2024
|
+
page-break-after: avoid;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
p, li {
|
|
2028
|
+
page-break-inside: avoid;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
ul, ol {
|
|
2032
|
+
page-break-inside: auto;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
img {
|
|
2036
|
+
page-break-inside: avoid;
|
|
2037
|
+
max-width: 100%;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
/* Maintain colors in print */
|
|
2041
|
+
.confidential,
|
|
2042
|
+
.separator {
|
|
2043
|
+
background-color: var(--color-accent) !important;
|
|
2044
|
+
color: white !important;
|
|
2045
|
+
-webkit-print-color-adjust: exact !important;
|
|
2046
|
+
print-color-adjust: exact !important;
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
.algorithm {
|
|
2050
|
+
break-inside: avoid;
|
|
2051
|
+
-webkit-print-color-adjust: exact;
|
|
2052
|
+
print-color-adjust: exact;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
/* Remove backgrounds for better printing */
|
|
2056
|
+
pre,
|
|
2057
|
+
code {
|
|
2058
|
+
background-color: transparent !important;
|
|
2059
|
+
border: 1px solid #ccc !important;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
`,
|
|
2063
|
+
|
|
2064
|
+
|
|
1588
2065
|
'modern': `/* Modern Clean Style */
|
|
1589
2066
|
.preview-container {
|
|
1590
2067
|
font-family: 'Segoe UI', system-ui, sans-serif;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "legal-markdown-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"build:ts": "tsc && tsc-alias",
|
|
10
10
|
"build:styles": "mkdir -p dist/styles && cp -r $(node scripts/build-paths.js styles)/* dist/styles/ 2>/dev/null || true",
|
|
11
11
|
"build:assets": "mkdir -p dist/assets && cp -r $(node scripts/build-paths.js images)/* dist/assets/ 2>/dev/null || true",
|
|
12
|
-
"build:web": "
|
|
12
|
+
"build:web": "node scripts/build-web.js",
|
|
13
13
|
"build:copy-umd": "cp dist/legal-markdown.umd.min.js dist/web/",
|
|
14
14
|
"build:umd": "webpack --mode production --config webpack.config.js",
|
|
15
15
|
"build:watch": "tsc --watch",
|