markdown-preview-enhanced icon indicating copy to clipboard operation
markdown-preview-enhanced copied to clipboard

Can't get line wrapping to work correctly with line numbers enabled

Open p-brane opened this issue 4 years ago • 1 comments

My markdown file

# Title

Some text here

## Topic 1

@import "./file.yang" {code_block=true class="line-numbers"}

The file.yang has one very long line that soft wraps in the editor perfectly, but does not in the preview. I added the line be;low to my local-style.less file. The long like does not wrap in the preview, but when I create a Chrome (Puppeteer) -> PDF, the line wraps. The numbers continue in sequence through the wrapped lines until they run out at the end and leave four or so lines without line numbers. I would have expected the line numbers to skip the line wraps. Does anyone have a work around for this issue? I can turn off the line number to fix the numbering, but can't tell form the pdf output which lines have been wrapped.

.markdown-preview.markdown-preview {
   @media print {
   // lines here not shown
    pre, code {white-space: pre-wrap;}
   // lines here not shown
}

p-brane avatar Dec 17 '20 05:12 p-brane

Having a similar problem: in style.less:

pre, code {
      white-space: pre-wrap;
  }

preview: image

rendered pdf with puppeteer: image

it would be really nice if the newlines were recognized by the line numbers.

gronk-droid avatar Apr 12 '22 07:04 gronk-droid