@vscode/markdown-editor 0.0.2-117 → 0.0.2-118

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/markdown-editor",
3
- "version": "0.0.2-117",
3
+ "version": "0.0.2-118",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -96,7 +96,8 @@
96
96
  "micromark-extension-gfm-strikethrough": "^2.1.0",
97
97
  "micromark-extension-gfm-table": "^2.1.1",
98
98
  "micromark-extension-gfm-task-list-item": "^2.1.0",
99
- "micromark-extension-math": "^3.1.0"
99
+ "micromark-extension-math": "^3.1.0",
100
+ "micromark-util-decode-string": "^2.0.1"
100
101
  },
101
102
  "devDependencies": {
102
103
  "@playwright/test": "1.56.1",
@@ -119,5 +120,5 @@
119
120
  "vitest": "^4.1.0",
120
121
  "zod": "^4.3.6"
121
122
  },
122
- "gitHead": "40666b73de7efda9a0b0b487a56342b4cbd33be9"
123
+ "gitHead": "3398cd4a37a0c24ace23ae3bf06d3924d4ea5068"
123
124
  }
@@ -27,6 +27,9 @@
27
27
  .md-editor {
28
28
  --md-marker-font-family: 'Cascadia Code', 'Fira Code', monospace;
29
29
  --md-marker-font-scale: 0.85;
30
+ --md-readonly-toggle-width: 58px;
31
+ --md-readonly-toggle-height: 32px;
32
+ --md-readonly-toggle-inset: 8px;
30
33
  display: flow-root;
31
34
  outline: none;
32
35
  /* The editor paints its own cursor (`.md-cursor`); hide the native caret. */
@@ -64,28 +67,29 @@
64
67
  * edge, independent of the first block's theme margins.
65
68
  */
66
69
  .md-editor-content {
67
- --md-editor-content-inline-start-padding: 48px;
68
- --md-readonly-toggle-width: 58px;
69
- --md-readonly-toggle-height: 32px;
70
- /* Leaves 16px of optical separation beyond the active block's 8px outset glow. */
71
- --md-readonly-toggle-gap: 24px;
72
- --md-readonly-toggle-inset: 4px;
70
+ --md-editor-min-inline-padding: 24px;
71
+ --md-editor-content-inline-start-padding: clamp(var(--md-editor-min-inline-padding), 8%, 80px);
73
72
  --md-editor-content-inline-end-padding: var(--md-editor-content-inline-start-padding);
74
73
  position: relative;
74
+ display: flow-root;
75
75
  margin-inline: auto;
76
76
  padding-block: 24px 0;
77
77
  padding-inline: var(--md-editor-content-inline-start-padding) var(--md-editor-content-inline-end-padding);
78
78
  }
79
79
 
80
- .md-editor-content-with-readonly-toggle {
81
- --md-editor-content-inline-end-padding: calc(var(--md-readonly-toggle-width) + var(--md-readonly-toggle-gap) + var(--md-readonly-toggle-inset));
80
+ .md-editor-content:has(> .md-document > .md-heading) {
81
+ --md-editor-min-inline-padding: 3.5em;
82
82
  }
83
83
 
84
- .md-editor-content-with-readonly-toggle>.md-document :is(.md-heading, .md-paragraph) {
84
+ .md-editor-content>.md-document :is(.md-heading, .md-paragraph) {
85
85
  overflow-wrap: anywhere;
86
86
  }
87
87
 
88
- .md-block-active {
88
+ .md-editor .md-document > .md-heading:first-child {
89
+ margin-block-start: 0;
90
+ }
91
+
92
+ :where(.md-editor:not(.md-no-active-block-highlight)) .md-block-active {
89
93
  background: var(--md-block-active-background, #f8f8f8);
90
94
  border-radius: 4px;
91
95
  box-shadow: 0 0 0 8px var(--md-block-active-background, #f8f8f8);
@@ -148,7 +152,7 @@
148
152
  .md-rich-link {
149
153
  display: inline-flex;
150
154
  align-items: baseline;
151
- max-width: min(100%, 52rem);
155
+ max-width: min(100%, var(--md-rich-link-line-width, 52rem));
152
156
  box-sizing: border-box;
153
157
  gap: 0.24em;
154
158
  padding: 1px 0.3em;
@@ -199,11 +203,19 @@
199
203
  }
200
204
 
201
205
  .md-rich-link-title {
202
- max-width: 200px;
206
+ max-width: var(--md-rich-link-title-width, 200px);
207
+ }
208
+
209
+ .md-rich-link-label {
210
+ max-width: var(--md-rich-link-title-width, none);
203
211
  }
204
212
 
205
213
  .md-rich-link[data-md-rich-link-kind='session'] :is(.md-rich-link-label, .md-rich-link-title) {
206
- max-width: 150px;
214
+ max-width: var(--md-rich-link-title-width, 150px);
215
+ }
216
+
217
+ .md-rich-link-line-end {
218
+ --md-rich-link-title-width: none;
207
219
  }
208
220
 
209
221
  .md-rich-link-label[hidden],
@@ -426,7 +438,7 @@
426
438
  ) :is(.md-rich-link-label, .md-rich-link-title) {
427
439
  position: relative;
428
440
  top: 0.25px;
429
- max-width: 200px;
441
+ max-width: var(--md-rich-link-title-width, 200px);
430
442
  color: inherit;
431
443
  font-weight: 400;
432
444
  }
@@ -841,7 +853,7 @@ pre.md-unhandled-scroll.md-code-block {
841
853
  left: 0;
842
854
  right: 0;
843
855
  text-align: center;
844
- color: #b0b0b0;
856
+ color: var(--md-whitespace-foreground, #b0b0b0);
845
857
  pointer-events: none;
846
858
  }
847
859
 
@@ -855,7 +867,7 @@ pre.md-unhandled-scroll.md-code-block {
855
867
 
856
868
  .md-ws-newline::before {
857
869
  content: '↵';
858
- color: #b0b0b0;
870
+ color: var(--md-whitespace-foreground, #b0b0b0);
859
871
  pointer-events: none;
860
872
  }
861
873
 
@@ -1028,6 +1040,10 @@ pre.md-unhandled-scroll.md-code-block {
1028
1040
  margin-inline-start: calc(-1 * var(--md-list-indent-step, 2em));
1029
1041
  }
1030
1042
 
1043
+ .md-source-editing .md-list > li > .md-empty-block {
1044
+ padding-inline-start: calc(var(--md-list-label-reserve) + var(--md-list-source-padding));
1045
+ }
1046
+
1031
1047
  .md-source-editing .md-glue-emptyLine {
1032
1048
  white-space: pre-wrap;
1033
1049
  visibility: visible;
@@ -1157,7 +1173,7 @@ pre.md-unhandled-scroll.md-code-block {
1157
1173
  * and drop it from the table, which keeps `md-block-active` purely for the
1158
1174
  * per-theme source-pipe styling.
1159
1175
  */
1160
- .md-table-wrapper:has(> .md-table.md-block-active) {
1176
+ :where(.md-editor:not(.md-no-active-block-highlight)) .md-table-wrapper:has(> .md-table.md-block-active) {
1161
1177
  background: var(--md-block-active-background, #f8f8f8);
1162
1178
  border-radius: 4px;
1163
1179
  box-shadow: 0 0 0 8px var(--md-block-active-background, #f8f8f8);
@@ -1517,7 +1533,8 @@ pre.md-unhandled-scroll.md-code-block {
1517
1533
  text-align: center;
1518
1534
  }
1519
1535
 
1520
- .md-marker-listItemMarker:has(> .md-list-marker-symbol) > :is(.md-ws-space, .md-ws-tab) {
1536
+ .md-marker-listItemMarker:has(> .md-list-marker-symbol) > :is(.md-ws-space, .md-ws-tab),
1537
+ .md-source-editing .md-list-continuation-separator {
1521
1538
  font-family: var(--md-marker-font-family);
1522
1539
  word-spacing: calc(0.5em - 1ch + var(--md-list-marker-reserve) / var(--md-list-marker-spaces));
1523
1540
  tab-size: calc(0.5em + var(--md-list-marker-reserve) / var(--md-list-marker-spaces));
@@ -1576,7 +1593,8 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker,
1576
1593
  align-items: center;
1577
1594
  }
1578
1595
 
1579
- .md-source-editing .md-list-gutter > .md-glue-indent {
1596
+ .md-source-editing .md-list-gutter > .md-glue-indent,
1597
+ .md-source-editing .md-list-continuation-indent {
1580
1598
  --md-source-indent-width: calc(var(--md-list-source-indent) * var(--md-list-indent-step, 2em));
1581
1599
  --md-source-space-width: calc(var(--md-source-indent-width) / var(--md-indent-length));
1582
1600
  flex-basis: var(--md-source-indent-width);
@@ -1587,6 +1605,27 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker,
1587
1605
  tab-size: var(--md-source-space-width);
1588
1606
  }
1589
1607
 
1608
+ .md-source-editing .md-task-list-item > .md-list-gutter > .md-glue-indent {
1609
+ --md-source-indent-width: calc(var(--md-list-source-indent) * var(--md-list-indent-step, 2em) / 2);
1610
+ }
1611
+
1612
+ .md-source-editing .md-list-continuation-prefix {
1613
+ font-family: var(--md-marker-font-family);
1614
+ white-space: pre;
1615
+ }
1616
+
1617
+ .md-source-editing .md-list-continuation-prefix > span {
1618
+ display: inline;
1619
+ }
1620
+
1621
+ .md-source-editing .md-list-continuation-symbol {
1622
+ word-spacing: calc(1em - 1ch);
1623
+ }
1624
+
1625
+ .md-source-editing .md-list-continuation-outside {
1626
+ margin-inline-start: calc((var(--md-list-level) - var(--md-list-source-indent)) * var(--md-list-indent-step, 2em) - 1.5em - var(--md-list-marker-reserve));
1627
+ }
1628
+
1590
1629
  .md-source-editing .md-list-gutter > .md-marker-listItemMarker.md-marker-hidden {
1591
1630
  display: inline-flex;
1592
1631
  visibility: hidden;
@@ -1661,16 +1700,9 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker,
1661
1700
  .md-task-list-item {
1662
1701
  list-style: none;
1663
1702
  position: relative;
1664
- /*
1665
- * Width of the checkbox / `[x]` source column. Single-sourced so the marker
1666
- * reservation on the first paragraph and the left indent of any following
1667
- * block (loose task items) stay in lockstep — keeping every block's text in
1668
- * one vertical column under the marker.
1669
- */
1670
1703
  }
1671
1704
 
1672
1705
  .md-list > li {
1673
- --md-task-marker-width: 1.75em;
1674
1706
  --md-list-label-reserve: 0em;
1675
1707
  --md-list-marker-reserve: var(--md-list-label-reserve);
1676
1708
  --md-list-source-padding: 0em;
@@ -1684,23 +1716,23 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker,
1684
1716
  --md-list-marker-reserve: 0em;
1685
1717
  }
1686
1718
 
1687
- .md-source-editing .md-list-with-task-items > li:not(.md-empty-block) {
1719
+ .md-list-with-task-items > li:not(.md-empty-block) {
1688
1720
  --md-list-label-reserve: 0.5em;
1689
1721
  }
1690
1722
 
1691
- .md-source-editing .md-list > li > .md-paragraph {
1723
+ .md-editor .md-list > li > .md-paragraph {
1692
1724
  padding-inline-start: calc(var(--md-list-label-reserve) + var(--md-list-source-padding));
1693
1725
  }
1694
1726
 
1695
- .md-source-editing .md-list > li > .md-list-item-line-anchor {
1727
+ .md-editor .md-list > li > .md-list-item-line-anchor {
1696
1728
  margin-inline-start: calc(var(--md-list-label-reserve) + var(--md-list-source-padding));
1697
1729
  }
1698
1730
 
1699
- .md-source-editing .md-list > li > .md-marker-listItemMarker {
1731
+ .md-editor .md-list > li > .md-marker-listItemMarker {
1700
1732
  right: calc(100% - (var(--md-list-label-reserve) + var(--md-list-source-padding)) / var(--md-marker-font-scale));
1701
1733
  }
1702
1734
 
1703
- .md-source-editing .md-list-gutter {
1735
+ .md-editor .md-list-gutter {
1704
1736
  right: calc(100% - var(--md-list-label-reserve) - var(--md-list-source-padding));
1705
1737
  }
1706
1738
 
@@ -1715,7 +1747,7 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker,
1715
1747
  tab-size: calc((0.5em + var(--md-list-marker-reserve) / var(--md-list-marker-spaces)) / var(--md-marker-font-scale));
1716
1748
  }
1717
1749
 
1718
- .md-source-editing .md-task-separator {
1750
+ .md-task-separator {
1719
1751
  position: absolute;
1720
1752
  left: calc(var(--md-list-source-padding) - 1em + 1.5ch * var(--md-marker-font-scale));
1721
1753
  top: 0;
@@ -1725,60 +1757,76 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker,
1725
1757
  tab-size: calc((1.5em - 1.5ch * var(--md-marker-font-scale)) / var(--md-separator-length));
1726
1758
  }
1727
1759
 
1728
- /*
1729
- * Reserve the marker column on the paragraph rather than only on its first
1730
- * inline child. This gives every wrapped line the same content edge. The
1731
- * source marker glue is positioned over that reserved column, as is the
1732
- * rendered checkbox, so activating the item does not shift its text (see the
1733
- * compare fixture's `checkMarkedTextX` assertion).
1734
- */
1735
- .md-task-list-item>.md-paragraph {
1736
- padding-left: var(--md-task-marker-width);
1737
- }
1738
-
1739
1760
  .md-task-list-item>.md-paragraph>.md-glue-taskListCheck {
1740
1761
  position: absolute;
1741
1762
  top: 0;
1742
- left: 0;
1743
- width: var(--md-task-marker-width);
1763
+ font-family: var(--md-marker-font-family);
1764
+ font-size: calc(1em * var(--md-marker-font-scale));
1765
+ left: calc((var(--md-list-source-padding) - 1em) / var(--md-marker-font-scale) - 1.5ch);
1766
+ width: 3ch;
1744
1767
  }
1745
1768
 
1746
- /*
1747
- * Following blocks in a loose task item (the second paragraph etc.) carry no
1748
- * marker glue, so indent them by the marker column to line their text up under
1749
- * the first paragraph's text rather than under the checkbox.
1750
- */
1751
- .md-task-list-item>.md-block+.md-block {
1752
- padding-left: var(--md-task-marker-width);
1769
+ .md-source-editing .md-task-list-item > .md-paragraph > .md-glue-taskListCheck {
1770
+ position: static;
1771
+ display: inline-block;
1772
+ margin-inline-start: calc((-1em - var(--md-list-label-reserve)) / var(--md-marker-font-scale) - 1.5ch);
1773
+ }
1774
+
1775
+ .md-source-editing .md-task-separator {
1776
+ position: static;
1777
+ }
1778
+
1779
+ .md-source-editing .md-list li > .md-paragraph > .md-list-continuation-prefix {
1780
+ right: calc(100% - var(--md-list-label-reserve) - var(--md-list-source-padding));
1781
+ }
1782
+
1783
+ .md-source-editing .md-list .md-code-block-container:has(> .md-code-list-source) {
1784
+ display: block;
1785
+ --md-list-prefix-width: calc(var(--md-list-source-indent) * var(--md-list-indent-step, 2em) + 1em + var(--md-list-marker-spaces) * 0.5em + var(--md-list-label-reserve));
1786
+ margin-inline-start: calc(var(--md-list-label-reserve) + var(--md-list-source-padding) - var(--md-list-prefix-width));
1787
+ }
1788
+
1789
+ .md-source-editing .md-list .md-code-list-source {
1790
+ position: relative;
1791
+ font-size: inherit;
1792
+ border-inline-start-width: 0;
1793
+ padding-inline-start: var(--md-list-prefix-width);
1794
+ }
1795
+
1796
+ .md-source-editing .md-list li > .md-code-block-container > .md-code-list-source > .md-list-continuation-prefix:first-child {
1797
+ right: calc(100% - var(--md-list-prefix-width));
1798
+ top: auto;
1799
+ }
1800
+
1801
+ .md-code-source-line {
1802
+ position: relative;
1753
1803
  }
1754
1804
 
1755
- .md-source-editing .md-task-list-item > .md-list-gutter {
1805
+ .md-code-source-line > .md-list-continuation-prefix {
1806
+ position: absolute;
1807
+ right: 100%;
1808
+ }
1809
+
1810
+ .md-editor .md-task-list-item > .md-list-gutter {
1756
1811
  right: calc(100% - var(--md-list-source-padding));
1757
1812
  }
1758
1813
 
1759
- .md-source-editing .md-task-list-item > .md-list-gutter::after {
1814
+ .md-task-list-item > .md-list-gutter::after {
1760
1815
  content: '';
1761
1816
  font-family: var(--md-marker-font-family);
1762
1817
  font-size: calc(1em * var(--md-marker-font-scale));
1763
1818
  flex: 0 0 calc(1em / var(--md-marker-font-scale) + 1.5ch);
1764
1819
  }
1765
1820
 
1766
- .md-source-editing .md-task-list-item > .md-paragraph > .md-glue-taskListCheck {
1767
- font-family: var(--md-marker-font-family);
1768
- font-size: calc(1em * var(--md-marker-font-scale));
1769
- left: calc((var(--md-list-source-padding) - 1em) / var(--md-marker-font-scale) - 1.5ch);
1770
- width: 3ch;
1771
- }
1772
-
1773
- .md-source-editing .md-task-list-item > .md-block + .md-block:not(.md-list) {
1821
+ .md-task-list-item > .md-block + .md-block:not(.md-list) {
1774
1822
  padding-left: calc(var(--md-list-label-reserve) + var(--md-list-source-padding));
1775
1823
  }
1776
1824
 
1777
- .md-source-editing .md-task-list-item > .md-list {
1825
+ .md-task-list-item > .md-list {
1778
1826
  padding-left: var(--md-list-indent-step, 2em);
1779
1827
  }
1780
1828
 
1781
- .md-source-editing .md-checkbox {
1829
+ .md-task-list-item > .md-checkbox {
1782
1830
  font-family: var(--md-marker-font-family);
1783
1831
  font-size: calc(1em * var(--md-marker-font-scale));
1784
1832
  left: calc((var(--md-list-source-padding) - 1em) / var(--md-marker-font-scale) - 8px);
@@ -1941,17 +1989,15 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker,
1941
1989
  /*
1942
1990
  * Edit / read-only lock toggle.
1943
1991
  *
1944
- * The asymmetric content padding reserves a real rail for the control:
1945
- * button width + gap + edge inset. The zero-height sticky host spans the
1946
- * document column and that rail, keeping the button beside (never over) the
1947
- * rendered document as it scrolls. Colors use local `--md-readonly-*` custom
1992
+ * The sticky overlay never changes text flow or the symmetric content margins.
1993
+ * Narrow margins let the control overlap content rather than reserving a rail.
1994
+ * Colors use local `--md-readonly-*` custom
1948
1995
  * properties with literal fallbacks so this base file stays theme-agnostic
1949
1996
  * (themes may override them).
1950
1997
  */
1951
1998
  .md-readonly-toggle-host {
1952
1999
  position: sticky;
1953
- top: 0;
1954
- width: calc(100% + var(--md-editor-content-inline-end-padding));
2000
+ top: var(--md-readonly-toggle-inset);
1955
2001
  height: 0;
1956
2002
  z-index: 10;
1957
2003
  pointer-events: none;
@@ -1985,17 +2031,6 @@ ol.md-list>.md-list-item-active>.md-list-gutter>.md-marker-listItemMarker,
1985
2031
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
1986
2032
  }
1987
2033
 
1988
- /*
1989
- * Below this width there is not enough document column for the side rail to be
1990
- * useful. Give the host its own row and stop it from sticking, so neither long
1991
- * unbreakable content nor later content scrolled through the viewport can ever
1992
- * pass underneath the button.
1993
- */
1994
- .md-editor-narrow .md-readonly-toggle-host {
1995
- position: relative;
1996
- height: calc(var(--md-readonly-toggle-height) + var(--md-readonly-toggle-inset) + var(--md-readonly-toggle-inset));
1997
- }
1998
-
1999
2034
  .md-readonly-toggle::after {
2000
2035
  content: '';
2001
2036
  position: absolute;
@@ -49,6 +49,7 @@
49
49
  * stays visible on dark color themes.
50
50
  */
51
51
  --md-cursor-background: var(--vscode-editorCursor-foreground, #000);
52
+ --md-whitespace-foreground: var(--vscode-editorWhitespace-foreground, #b0b0b0);
52
53
  --md-html-comment-foreground: var(--vscode-descriptionForeground, #616161);
53
54
  --md-html-comment-hover-foreground: var(--vscode-editor-foreground, #1f2328);
54
55
  --md-html-comment-font-family: var(--vscode-editor-font-family, ui-monospace, SFMono-Regular,
@@ -58,6 +58,7 @@
58
58
  * stays visible on dark color themes.
59
59
  */
60
60
  --md-cursor-background: var(--vscode-editorCursor-foreground, #000);
61
+ --md-whitespace-foreground: var(--vscode-editorWhitespace-foreground, #b0b0b0);
61
62
  --md-html-comment-foreground: var(--vscode-descriptionForeground, #59636e);
62
63
  --md-html-comment-hover-foreground: var(--vscode-editor-foreground, #1f2328);
63
64
  --md-html-comment-font-family: var(--vscode-editor-font-family, ui-monospace, SFMono-Regular,