File tree 2 files changed +10
-4
lines changed
packages/site-kit/src/lib
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 75
75
h 2,
76
76
h 3 {
77
77
max-width : 100% ;
78
- text-overflow : ellipsis ;
79
- overflow : hidden ;
80
78
padding : 0 1em 0 0 ;
81
79
82
80
@media (min-width : 768px ) {
83
81
margin : 0 0 0 -2em ;
84
82
padding : 0 1em 0 2em ;
85
83
}
84
+
85
+ /* we can't use `text-overflow` on the heading itself,
86
+ because `overflow: hidden` defeats `scroll-margin` */
87
+ & > span {
88
+ display : block ;
89
+ overflow : hidden ;
90
+ text-overflow : ellipsis ;
91
+ }
86
92
}
87
93
88
94
h2 {
Original file line number Diff line number Diff line change @@ -269,10 +269,10 @@ export async function render_content_markdown(
269
269
headings [ depth - 1 ] = slugify ( raw ) ;
270
270
headings . length = depth ;
271
271
const slug = headings . filter ( Boolean ) . join ( '-' ) ;
272
- return `<h${ depth } id="${ slug } ">${ text . replace (
272
+ return `<h${ depth } id="${ slug } "><span> ${ text . replace (
273
273
/ < \/ ? c o d e > / g,
274
274
''
275
- ) } <a href="#${ slug } " class="permalink"><span class="visually-hidden">permalink</span></a></h${ depth } >`;
275
+ ) } </span>< a href="#${ slug } " class="permalink"><span class="visually-hidden">permalink</span></a></h${ depth } >`;
276
276
} ,
277
277
code ( { text } ) {
278
278
return snippets . get ( text ) ;
You can’t perform that action at this time.
0 commit comments