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
1
vote
1 answer

Uncaught Typeerror: Cannot read properties of undefined (reading 'addSupport')

So I started on renewing the Stackedit project. I upgraded all dependencies and updated to ES6. The app is already starting but once I get to the Vue part of the application localhost:8080/app I get this error Uncaught TypeError: Cannot read…
SamTV
  • 147
  • 1
  • 11
1
vote
0 answers

PrismJs line numbers for code blocks inside an expandable div appear wrapped. Recover when zoomed in/out

I am trying to add line numbers to code blocks using PrismJs Line Numbers plugin. The code blocks are included within an expanded div as shown below:

1
vote
0 answers

Prism code rendering and JSX markdown not working on static HTML page

I have been trying to implement prism on a static HTML page to show code blocks for a basic skills portfolio site. I have imported Prism into the relevant places on the page in a script tag and in a CSS link tag. I also did the required
Byron
  • 75
  • 9
1
vote
1 answer

Use PrismJS without syntax highlighting?

I'm experiencing this issue here: https://github.com/PrismJS/prism/issues/3339 with the PrismJS plugin: https://prismjs.com/. Larger scripts are freezing mobile devices, and ultimately becoming unresponsive. So for now I'm not rendering Prism on…
Captain_Planet
  • 1,228
  • 1
  • 12
  • 28
1
vote
1 answer

Using prism.js inside lit webcomponent

I use lit webcomponents with the vite + typescript template. Now i am trying to create my own code block web-component. For syntax highlighting I wanted to use prism js, so i went to their page, selected my favorite languages, downloaded both css…
Kevin Frey
  • 59
  • 5
1
vote
0 answers

Syntax highlighting via Prism in Glorious Demo

So I found out about 'Glorious Demo' today, and I'm testing out a demo of it. After getting Glorious Demo to work initially, I tried adding syntax highlighting via Prism. However, when I add the line const highlightedCode = Prism.highlight(code,…
Sid
  • 51
  • 5
1
vote
1 answer

warning Lockfile has incorrect entry for "prismjs@1.24.0". Ignoring it

I have inherited an issue with prismjs whereby I have to remove/reinstall it every time I add/upgrade another package. I have a gocd pipeline validation that fails every time I try to use dependabot to address security vulnerabilities on my…
1
vote
0 answers

How can I add custom Prism.js styles in ReactTinyMCE for codesample formatting and highlighting?

Here is my TinyMCE configuration for react I used @tinymce/tinymce-react. I checked on how to add customized theme width Prism.js but it's not working. I wanted to use okaidia theme Anyone who knows how to use custom stylings for codesample with…
amani
  • 23
  • 4
1
vote
1 answer

Adjust `prism.js` code snippet box width according to text width

My HTML is as follows:
import time

print(time.time())
user17794345
1
vote
1 answer

How to highlight React tsx with PrismJS

I have this html file: Test PrismJS

      // Display…
acmoune
  • 2,981
  • 3
  • 24
  • 41
1
vote
1 answer

Regex match all excluding a delimiter

I have two sample strings of code like so: "const x = anything;" "const {a, b, c, d} = anything;" I want to match x, as well as a, b, c, and d (none of which are literal, they can be any valid JavaScript variable character(s), but are delimited by…
frosty
  • 2,779
  • 6
  • 34
  • 63
1
vote
2 answers

PrismJS syntax highlighting is broken due to conflicts with Bulma

PrismJS syntax highlighting is broken when used together with Bulma. Both PrismJS and Bulma use the number and tag classes. So, there is a conflict between PrismJS and Bulma. Are there any workarounds?
Eugene Khyst
  • 9,236
  • 7
  • 38
  • 65
1
vote
1 answer

Svelte js with store and Prism library issue

I'm trying to add the Prism library (https://prismjs.com/) to the Svelte 3 app. Once I add the Prism script, store variables stop been updated. store.js import { writable } from 'svelte/store'; const store = writable({ num: 1 }); export default…
Miriam Zusin
  • 186
  • 3
  • 9
1
vote
1 answer

11ty Pass template data to a syntax highlighted tag

So, I've got a template that brings data from a collection, this specific collection has info about some fonts, and I need to output a block of syntax highlighted code, this code references how the font should be added using @fontface for example: …
Bunni Gek
  • 15
  • 4
1
vote
1 answer

How to output HTML from graphql in Gatsby

I'm using Prismic CMS and Gatsby (both latest version) and the officical gatsby-source-prismic plugin. I'm trying to fetch blog posts from Prismic and display them on my blogpage which works fine. The only thing I struggle is the HTML Serializer at…
Marek123
  • 1,193
  • 7
  • 35
  • 75
1 2 3
8 9