@scalar/code-highlight 0.4.11 → 0.4.12

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @scalar/code-highlight
2
2
 
3
+ ## 0.4.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#10742](https://github.com/scalar/scalar/pull/10742): Restore the 1.4 default for highlighted code block containers after the highlighter migration, including plain text and blank lines, while allowing Markdown to retain its own spacing.
8
+ - [#10849](https://github.com/scalar/scalar/pull/10849): Make code block containers own line spacing so highlighted text, plain text, blank lines, and line numbers use the same height. ScalarCodeBlock defaults to 1.4 and Markdown fenced code defaults to 1.5; override either with --scalar-code-line-height on the component or an ancestor. The shared highlighting stylesheet preserves the 1.4 default for direct consumers with a zero-specificity container rule, so existing container overrides still take precedence.
9
+
3
10
  ## 0.4.11
4
11
 
5
12
  ### Patch Changes
package/dist/css/code.css CHANGED
@@ -1,3 +1,8 @@
1
+ /* Keep direct stylesheet consumers at the default spacing without competing with container overrides. */
2
+ :where(pre:has(> code.hljs)) {
3
+ line-height: var(--scalar-code-line-height, 1.4);
4
+ }
5
+
1
6
  .scalar-app {
2
7
  :where(code.hljs) * {
3
8
  font-size: inherit;
@@ -12,18 +17,6 @@
12
17
  code.hljs {
13
18
  all: unset;
14
19
  font-size: inherit;
15
- /*
16
- * On the code element, not on `:where(code.hljs) *`, because that selector
17
- * reaches elements and never text nodes. A highlighter emits a token span
18
- * only where it has a scope to give, so a line of entirely unscoped text —
19
- * the content between two JSX tags, say — held no element and fell back to
20
- * the surrounding line height, rendering a couple of pixels shorter than
21
- * the lines around it. Line numbers hid this: that mode wraps every line in
22
- * `span.line`, which is an element, so the same block rendered evenly with
23
- * a gutter and unevenly without one. Declared here it sets the line box for
24
- * every line, and the spans inherit it.
25
- */
26
- line-height: 1.4;
27
20
  color: var(--scalar-color-2);
28
21
  font-family: var(--scalar-font-code);
29
22
  counter-reset: linenumber;
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "lowlight",
17
17
  "highlightjs"
18
18
  ],
19
- "version": "0.4.11",
19
+ "version": "0.4.12",
20
20
  "engines": {
21
21
  "node": ">=22"
22
22
  },
@@ -88,7 +88,7 @@
88
88
  "unist-util-visit": "^5.1.0"
89
89
  },
90
90
  "devDependencies": {
91
- "@scalar/themes": "0.19.3",
91
+ "@scalar/themes": "0.20.0",
92
92
  "@types/hast": "^3.0.5",
93
93
  "@types/mdast": "^4.0.4",
94
94
  "vfile": "^6.0.3",