wiki icon indicating copy to clipboard operation
wiki copied to clipboard

Incorrect preview in mardown editor for html blockcode

Open SharkProgramming opened this issue 7 years ago • 9 comments

Describe the bug Incorrect preview in mardown editor for html blockcode or inline code

To Reproduce Steps to reproduce the behavior:

  1. Go to New page
  2. Choose Markdown Editor
  3. Write HTML in inline code or block code with language html defined
  4. See error

Expected behavior We have just to see the html like presented in the blockcode not the interpretation of the html

Screenshots issue

Error Message La ressource à l’adresse « http://192.168.8.86:1337/e/en/style.css » a été bloquée en raison d’un type MIME (« text/html ») incorrect (X-Content-Type-Options: nosniff).

Host Info (please complete the following information):

  • OS: Ubuntu 18.04.3
  • Wiki.js version: 2.0.0-rc.17
  • Database engine: MariaDB 10.3.18

SharkProgramming avatar Nov 05 '19 08:11 SharkProgramming

I have a similar example and actually I think this issue could lead to a security issue. image

Some observations:

  • If I save the page the final rendering is fine.

  • If I remove the < and > characters, the preview in the editor is fine.

  • If I play with the editor and I use <h1> here is what happens: image

Host info:

  • OS: Docker Container (Linux)
  • Wiki.js: 2.0.12
  • Database engine: PostgreSQL 9.6.15

dash00 avatar Nov 28 '19 08:11 dash00

I found similar issue when toggling preview pane, which make the code block become bigger and shadowed font.

changsijay avatar Dec 01 '19 13:12 changsijay

I am having this issue as well.

ccolella-mdc avatar Dec 09 '19 23:12 ccolella-mdc

I am having the same issue as well.

samprince1991 avatar Dec 20 '19 06:12 samprince1991

Same here, I just wanted to add linked task: https://github.com/Requarks/wiki/issues/1370

Yivan avatar Jan 13 '20 18:01 Yivan

@NGPixel I would like to add that it should be really prioritized please, because it can break totally the preview page, meaning we can no more preview at all.

Using this code:

<?php

include __DIR__ . "/../../../vendor/autoload.php"; // chemin à adapter selon l'emplacement du script

\Pimcore\Bootstrap::setProjectRoot();
\Pimcore\Bootstrap::bootstrap();

// On peut maintenant appeler les méthodes Pimcore

// On peut aussi paramétrer PHP
error_reporting(E_ALL); // on affiche même les erreurs de niveau notice
set_time_limit(0); // pas de limite de temps
ini_set('memory_limit', '2048M'); // on alloue davantage de mémoire

Lead to:

image

I hope it could really be fixed soon. As it is a core feature the preview mode and very helpfull.

Thanks a lot.

Yivan avatar Jan 13 '20 18:01 Yivan

I'm seeing something similar in v2.1.113, trying to add Razor code to a Markdown page. The preview shows the code perfectly, but the page itself doesn't.

Markdown: image

Preview: image

Rendered page: image

RichardD2 avatar Feb 28 '20 15:02 RichardD2

If I HTML-encode the HTML block in the Markdown, the preview shows the encoded value, but the page shows the correct value.

Markdown: image

Preview: image

Page: image

RichardD2 avatar Feb 28 '20 15:02 RichardD2

Fixed by b529ad21c97a7093e9ecc35e2e72fb8148f0c9d0

NGPixel avatar Mar 21 '20 19:03 NGPixel