Skip to content

Code blocks not retaining monospace font on export #5576

Closed
@Hallsie

Description

@Hallsie

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:

Image

That is on the page. And below is in the PDF:

Image

As you can see it looks completely different because the * no longer has equal spacing. Also, the line numbers are gone.

Steps to Reproduce

  1. 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.
  2. save
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions