Comments (7)
A workaround for now is to set
window.Prism = window.Prism || {};
Prism.manual = true;
at an early stage.
PrismJS documentation regarding the manual
property.
Suggested by a maintainer in PrismJS/prism#3066 (comment)
to stop Prism from re-highlighting the code.
from redocusaurus.
I appreciate it. I did notice this same issue occurring on another site that uses Redocusaurus: https://docs.spectacles.dev/app/tutorials/getting-started/
If you expand Reference in the left TOC and hover over API, the code block on the page collapses into a single line. (You may have to refresh the page in order to reproduce - it doesn't always happen consistently.)
from redocusaurus.
I can reproduce the issue using the example content in this repository by adding a navbar / sidebar link to an API documentation page.
As an optimization measure on link hover, Docusaurus loads http://localhost:3000/vendors-node_modules_redoc_bundles_redoc_lib_js.js
, which includes its own copy of PrismJS. This seems to interfere with the existing PrismJS bundled by Docusaurus, causing the render output to break.
from redocusaurus.
The natural place would be somewhere in index.html
, but as that's kinda hard to reach, I'm setting it in a swizzled <Layout/>
component... And I don't know if this plugin should inject that to avoid other problems that might come up.
Maybe an issue could be raised in the Docusaurus repo to continue the discussion there first, as this is a fairly popular plugin, after all.
from redocusaurus.
I don't think this could be because of redoc, but I'll try to reproduce in my repo.
from redocusaurus.
@ygerg Do you have any guidance as to where/how to set this in our Docusaurus sites?
from redocusaurus.
And I don't know if this plugin should inject that to avoid other problems that might come up.
I would be open to add it behind a flag in the config. Could add it here: https://github.com/rohit-gohri/redocusaurus/blob/main/packages/docusaurus-theme-redoc/src/redocTheme.ts so it gets loaded before we load redoc. I think it would work.
If anyone wants to open a PR, feel free.
from redocusaurus.
Related Issues (20)
- Rendering Definitions in Redoc using swagger docs HOT 1
- Render mermaid embedded within swagger/openapi
- Error: "presets[0]" does not match any of the allowed types HOT 2
- Webpack "Failed to fetch" issue HOT 8
- Memory regeneration problem when generating with cyclic dependencies HOT 6
- Extend deploy script to sign git commits. HOT 1
- [ERROR] TypeError: Cannot set properties of undefined (setting 'minItems') HOT 9
- CSS broken HOT 1
- Callbacks lack proper background in dark mode HOT 1
- Is there a way to run the APIs through the redoc component ? HOT 1
- Support for Docusaurus 3.0 HOT 9
- Example not hidden for schema imports
- Redocusaurus should collect heading ids / anchors HOT 2
- Webpack missing in Peer Dependencies HOT 1
- Error: Docusaurus server-side rendering could not render static page with path /api/ because of error: slugify: string argument expected HOT 2
- Issue with calling useColorMode outside the ColorModeProvider for Docusaurus 3.0.1 HOT 5
- Logo from spec (x-logo) not being rendered. HOT 3
- Add warning for deprecated options and remove them in next breaking version
- Generate code samples
- Support versioning API along with docs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redocusaurus.