We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
max_lines
data-max-lines
1 parent 912077f commit 9258de6Copy full SHA for 9258de6
assets/mods/code-block-panel/js/panel.ts
@@ -48,8 +48,9 @@ export default class Panel {
48
49
private maxLines() {
50
const lines = this.lines()
51
- if (params.max_lines > 0 && lines.length > params.max_lines) {
52
- const offsetTop = lines[params.max_lines - 1].offsetTop
+ const maxLines = this.code.closest('.highlight')?.getAttribute('data-max-lines') ?? params.max_lines
+ if (maxLines > 0 && lines.length > maxLines) {
53
+ const offsetTop = lines[maxLines].offsetTop
54
if (offsetTop > 0) {
55
this.pre.style.maxHeight = this.maxHeight = offsetTop + 'px'
56
}
0 commit comments