wiki icon indicating copy to clipboard operation
wiki copied to clipboard

Incorrect render of html blockcode

Open SharkProgramming opened this issue 6 years ago • 2 comments

Describe the bug There is a problem with the render of a complete html page in blockcode

To Reproduce Steps to reproduce the behavior:

  1. Create a page
  2. Insert blockcode with html source page like:
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>300</p>
</body>
</html>
  1. Save the page and you can see that the is going outside the blockcode
  2. Take a look at the table of content , it appears a link called An error occured

Expected behavior All html code have to stay inside the blockcode in the page visible by every user of the wiki.

Screenshots issue_render_html

Host Info (please complete the following information):

  • OS: Linux - Ubuntu Linux (bionic) 18.04 x64
  • Wiki.js version: 2.1.113
  • Database engine: PostgreSQL 10.10

Additional The preview in markdown editor looks good

SharkProgramming avatar Feb 24 '20 13:02 SharkProgramming

I've had that too. A workaround I've used is to use &lt; and &gt; to escape standard tags like h1 and div.

chris-m92 avatar Apr 22 '20 02:04 chris-m92

This was fixed in 2.2. please upgrade to the latest version.

NGPixel avatar Apr 22 '20 02:04 NGPixel