mirror of
https://github.com/requarks/wiki.git
synced 2026-03-02 22:57:36 -05:00
Code Block inside info block blurry #1043
Labels
No labels
BETA
BETA
accessibility
backlog
bug
can't replicate
contrib-easy
contrib-hard
contrib-medium
deferred
documentation
duplicate
duplicate
editors
enhancement
invalid
localization
migrate
ui
under review
v3
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/wiki#1043
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Just-Insane on GitHub (Jan 25, 2020).
Originally assigned to: @NGPixel on GitHub.
Describe the bug
When there is a code block inside of an info block, the text in the code block becomes blurred unless highlighted.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The code block text should not be blurry when inside of an info block.
Screenshots
Shows the code block inside an info block being blurry.

Shows the code block inside an info block with clear text when highlighted, and compared to a code block outside the info block.

Host Info (please complete the following information):
Additional context
Using Cloudflare as a CDN (however the js & performance features have been disabled since it causes issues with Subresource Integrity, even when turned off in the admin panel).
@NGPixel commented on GitHub (Jan 27, 2020):
Blockquotes aren't meant to encapsulate code blocks, but this a bug nonetheless
@Just-Insane commented on GitHub (Jan 27, 2020):
I feel like putting code inside blockquotes is a valid use case. Could you explain why blockquotes aren’t meant to hold code blocks?
@dprensha commented on GitHub (Jan 28, 2020):
While certainly not the ideal solution, I was able to get around this by adding a CSS override:
@lilnayners commented on GitHub (Jan 31, 2020):
The blurriness is caused by the text shadow, but the real problem is the light blue background being applied to the code block. There is a block of code in the scss that applies the light blue background to a code block inside of the info box. I'll submit a PR for it, I'm removing the code block. I feel that a code block should retain the black background, unless you also want to re-write the syntax highlighting color theme, which seems like overkill.
@max13fr commented on GitHub (May 11, 2020):
Hello,
I just got the same issue but not inside a blockquote (directly in the page). Everything was fine still my page edit of today :
In edit mode everything is displaying fine, it's really strange :
I tried to clean all caches (servers & browsers) and regenerate the page without any improvement.
Thanks in advance,
Max
PS : I'm running the last version 2.3.81 on docker
@regevbr commented on GitHub (Jun 7, 2020):
@max13fr how do you achieve this cool styling for the code snippets?
@max13fr commented on GitHub (Jun 8, 2020):
You surround your code with three backticks before & after : https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks
@regevbr commented on GitHub (Jun 8, 2020):
Thanks, i know how to use code fence, I was asking about the style. You have a computer screen like theme which I'm asking how to achieve it.
@max13fr commented on GitHub (Jun 8, 2020):
I use the default wikijs theme (without dark mode) on the last version.
For the highlight, you can add the language after the 3 first backtick (here it's sql)
@regevbr commented on GitHub (Jun 8, 2020):
I'm aware of that. I'm getting

But in https://user-images.githubusercontent.com/1089463/81538289-db1cba00-936e-11ea-9d52-cac59d3208f7.png there is a different styling which I saw in slack other people have as well.
Maybe it just comes from other programs that are not related and then my question is stale...
@NGPixel commented on GitHub (Jun 8, 2020):
Are you referring to the white background? That's a bug... it's supposed to be dark.
@regevbr commented on GitHub (Jun 8, 2020):
Yes that is what I was referring too. It played a trick on my mind, causing me to think that there is some custom css styling for code fences that emulates a terminal screen inside a computer screen like box. wishful thinking I guess...
@GeorgeGedox commented on GitHub (Sep 2, 2020):
Any updates on this? Using markdown with code blocks results in unreadable code snippets
@max13fr commented on GitHub (Oct 9, 2020):
Hello,
I compared with code block display in preview edition that doesn't have the issue.
The class prismjs is missing on <pre> when displaying the normal page.
Here an example with the following mardown :
On editor mode the block generate this html (correct) :
When displaying the page, the block generate this html (incorrect, missing prismjs class on pre) :
Max
@birdwing commented on GitHub (Mar 3, 2021):
We also are getting this issue when Codeblocks are inside of tabsets:

However if the codeblock is outside of a tabset it renders just fine.
I will note that this was working fine until today. We have changed absolutely nothing. Haven't updated, haven't changed any settings. In fact a few weeks ago we had codeblocks inside of tabsets that worked just fine
Sadly though, in an attempt to fix it we "re-rendered" every page, and now even the pages that were working are now broken.
We are running that latest version of wiki.js (2.5.170)
@max13fr commented on GitHub (Jul 11, 2021):
Hi,
I find a quickfix to avoid this ugly display.
In themes page, you can inject code in the html body. Just put this in it :
Not perfect (no line numbers, no copy button), but still much better than nothing :)
Max
@exglade commented on GitHub (Jul 22, 2021):
I manage to reproduce the issue consistently on my setup. The problem seems to be caused by disabling Settings > Rendering > HTML ➡ HTML > Core.
Figure 1: HTML ➡ HTML > Core renderer disabled

Figure 2: HTML ➡ HTML > Core renderer enabled

Edit:
On top of that, the Syntax Highlighter renderer should also be enabled which would add
prismjsandline-numbersCSS class to the element.@fcqpl commented on GitHub (Nov 3, 2021):
Is this will be fixed? I got this bug also.

With enabled HTML->HTML Core renderer - nothing changes.
In editor it looks normal:
On page:

@NGPixel commented on GitHub (Nov 3, 2021):
@fcqpl Did you re-save the page again after enabling the HTML Core Renderer and Syntax Highlighter?
@fcqpl commented on GitHub (Nov 3, 2021):
@NGPixel
Ouch, it worked afer re-save page. Thanks!
@geloczi commented on GitHub (Nov 13, 2021):
Hello Everyone,
I've just installed version 2.5.219 and I just created a simple test page. Unfortunately I have the very same behaviour while editing the page using ckeditor.
Version: 2.5.219
Host environment: docker
Configuration: default out-of-the-box configuration
In this version, the problematic text-shadow setting is coming from "/_assets/css/vendor.1c8e0b1b9f1d9d4bceda.css" file:
text-shadow: 0 -.1em .2em #000;After checking the source code I see that it is coming from prism.css
I'm using the following CSS as a work-around:
@vinoo23 commented on GitHub (Jun 14, 2025):
Hi,
With last wiki.js version 2.5.307 tarball on debian 12 full updated, i still have this problem on firefox and chrome full updated too.
CSS overide seem to resolve this issue proposed by geloczi.
Is it possible to integrate this in next release?
@geloczi commented on GitHub (Jun 16, 2025):
Hi,
Good to hear it is still working. I extended it a bit since to cover my use case at least:
Despite it is an effective work-around, I'm not sure it qualifies as a proper fix.