vscode-markdown-pdf icon indicating copy to clipboard operation
vscode-markdown-pdf copied to clipboard

Invalid HTML in readme

Open Venryx opened this issue 4 years ago • 0 comments

The readme contains the following text:

Page Break

Please use the following to insert a page break. <div class="page"/>

For the primary function, this works fine.

However:

  1. This is invalid HTML. (see here and here)
  2. It can lead to some practical, negative effects. (as I discovered)

Specifically, the negative effect is that, when exporting to HTML, I found that at every place I put:

<div class="page"/>

The exported HTML page would "capture" all content beneath that line within that "page" div!

Graphically, this is not an issue in most cases, but it was causing issues in my case because I had css styling of some of the pages (and elements within them), and the fact that each page-break was "capturing" everything beneath into a new div was causing styling to get applied to areas it wasn't supposed to.

The solution? Simple.

Replace the invalid:

<div class="page"/>

With the valid:

<div class="page"></div>

I recommend adding this change to the Readme as well, to prevent other users from hitting the same issue. In most cases the error is harmless; but in some cases, as I found, it can lead to hard-to-pin-down styling issues. (I only identified the source of the problem when I opened the developer-tools and inspected the element tree)

Venryx avatar Apr 13 '21 04:04 Venryx