Questions tagged [prismjs]

PrismJS is a JavaScript based syntax highlighter. Please also include the tag for the JavaScript technology you are using, for example: [javascript], [reactjs], [node.js], etc. Please do NOT include the tag of the language you are trying to highlight.

PrismJS is an extensible JavaScript-based syntax highlighter.

The Documentation:

124 questions
0
votes
0 answers

Prismjs with Rails 7 is trying to do a GET request on the css

I installed Prismjs via yarn: yarn add prismjs Then in my app/javascript/application.js I added: import Prism from 'prismjs'; and in my app/assets/stylesheets/application.scss I have added: @import '~prismjs/themes/prism.css'; and rails rails…
Patrick Vellia
  • 399
  • 2
  • 9
0
votes
1 answer

Can not get horizontal scroll bar on

No matter what I do, I can NOT get the code block to create its own scroll bar on smaller breakpoints. It continuosly creates a full page scroll bar. here is the live preview with the error. I tried every form of overflow property. I tried wrapping…
0
votes
2 answers

How do i set width for the codebox (PrismJS)

So i am basically trying to set width for the codebox (i am using prismJS), when i add too big of a code it breaks everything and the width and height get increased. I want the width and height to be specified so if the code is too long it just adds…
0
votes
0 answers

PrismJS YAML syntax highlighting double line break

When using PrismJS with YAML block that has a double newline, it doesn't highlight correctly after the blank line. Does anyone know how to solve this? Attaching a screenshot of correct highlighting from onlineyamltools.com to show what I mean. It…
specimen
  • 1,735
  • 14
  • 23
0
votes
1 answer

How to convert from <%= form_for @post do |f| %> to form_with

Building my first rails app with a built-in blog using form_for but noticed that it's now been replaced with form_with... I need to update to the new format as I would like to add TinyMCE or action_text so I can add images, style blog posts ect and…
Karl
  • 21
  • 3
0
votes
1 answer

Lags in caret display (caret does not reset on position change)

I'm using Prismjs in my React app and everything's working fine. I just have a caret display lag whenever I move it using my keyboard arrows. In standard inputs/textareas, it looks like the caret sort of "resets" its cycle when moved. But here, it…
FlowRan
  • 119
  • 1
  • 15
0
votes
2 answers

Why is my React code editor component not highlighted by PrismJs?

I just discovered PrismJs and it looks perfect. But for some reason, it doesn't highlight my code in following component : import { useState, useEffect } from "react"; import Prism from "prismjs"; export default function EditCode() { const…
FlowRan
  • 119
  • 1
  • 15
0
votes
1 answer

How to modify font-size for docsify prismjs code blocks?

Docsify uses prismjs to syntax highlighting. I have tried to insert styles in the index.html but nothing is taking effect (I can modify the font-size with effect in chrome dev tools) Have tried something like this.