You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As stated. I put a code block in with say 10 lines of code. When I export to a PDF it keeps it in a frame but the font is not a fixed width font anymore and things do not look correct:
That is on the page. And below is in the PDF:
As you can see it looks completely different because the * no longer has equal spacing. Also, the line numbers are gone.
Steps to Reproduce
in a document, make a code block and do some typing and line up things. Make it multiple lines and use all caps or mix, shouldn't matter it should all line up correctly because of the fixed width font.
save
export the pdf and see it is not the same anymore and that the code line numbers are gone as well.
Expected Behaviour
I would expect a code block to come out on a PDF the way it looks on the site, fixed width terminal style font with line numbers in a box. The box is there, but the other two things are not.
Screenshots or Additional Context
No response
Browser Details
Chrome 135.0.7049.85 (64-bit)
Exact BookStack Version
v25.02
The text was updated successfully, but these errors were encountered:
I can confirm the lack of monospace code font to be a bug, related to this: sass/dart-sass#472
The BOM is breaking all CSS variables, including code fonts, leading to this result.
We'll need to strip or handle this BOM character as part of our process.
I'm going to update this bug report to focus on that.
In regards to line numbers, that's somewhat by design.
Line numbers (and other code ability) are handled on the JavaScript side currently, leaving the original underlying code/stored state as plain as possible and a plain (pre>code) block.
Feel free to raise this as a separate feature request though if strongly desired.
ssddanbrown
changed the title
Code blocks do not export as code blocks with line numbers to PDF
Code blocks not retaining monospace font on export
Apr 12, 2025
Describe the Bug
As stated. I put a code block in with say 10 lines of code. When I export to a PDF it keeps it in a frame but the font is not a fixed width font anymore and things do not look correct:
That is on the page. And below is in the PDF:
As you can see it looks completely different because the * no longer has equal spacing. Also, the line numbers are gone.
Steps to Reproduce
Expected Behaviour
I would expect a code block to come out on a PDF the way it looks on the site, fixed width terminal style font with line numbers in a box. The box is there, but the other two things are not.
Screenshots or Additional Context
No response
Browser Details
Chrome 135.0.7049.85 (64-bit)
Exact BookStack Version
v25.02
The text was updated successfully, but these errors were encountered: