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
2
votes
1 answer

Issue with prism-react-renderer highlighting in production build in Gatsby

I am facing an issue with code highlighting when using prism-react-renderer component in Gatsby. I have configured it as per instructions in FormidableLabs/prism-react-renderer. Everything works in development mode, but when I build a production…
Subhash
  • 3,121
  • 1
  • 19
  • 25
2
votes
1 answer

How to turn off text-shadow in a PrismJS CSS theme?

I'm trying to format a code block in Gatsby with Prism.js, but the built-in CSS that I import adds a text-shadow that makes it look awful: When I toggle off the text-shadow in Chrome DevTools, it looks great: However, I can't figure out how to do…
James Shapiro
  • 4,805
  • 3
  • 31
  • 46
2
votes
1 answer

Prismjs: regex positive lookbehind equivalent?

I'm using Prism.js which is syntax highlighter, and it highlights the word matching certain regex. I want to match any word after the word git, so I tried to use positive lookbehind like this. (?<=git )\w+ Unfortunately, it seems that positive…
CookieHCl
  • 31
  • 6
2
votes
1 answer

Prism.js highlight only if it begins the line

I'm writing a custom language extension to Prism.js and have a problem highlighting comments. I want to highlight comments, that begin with either # or // and start at the beginning of the line: # Example comment // Example comment 1*2//comment <--…
2
votes
1 answer

PrismJS with React : using babel-plugin-prismjs

I recently decided to use PrismJS with React and to avoid import repetitions I managed to use this babel-plugin-prismjs package in order to load plugins, languages and so on. As indicated in the plugin documentation, I've created a .babelrc file…
Aurelle
  • 23
  • 3
2
votes
0 answers

Prism.js in Angular works for the first code block (Code syntax highlighting)

According to this article After installing the following package npm install prismjs --save Then I created a service named: HighlightService import { Injectable } from '@angular/core'; import 'prismjs'; import…
Mina Mohammadi
  • 285
  • 1
  • 4
  • 14
2
votes
0 answers

How to add an already supported language in CodeFlask

Hi I am using the micro code editor CodeFlask, I have configured it but I don't know how to add another language that is not JS. The documentation explains about using flask.addLanguage('ruby', option) but it does not explains what options means.…
Eduardo Alvarez
  • 224
  • 2
  • 9
2
votes
1 answer

Making PrismJS syntax highliting work in Aurelia

I am trying to add PrismJS as syntax highliter in my Aurelia app (typescript based) and I am half way there as below 1- Install prismjs yarn add prismjs 2- add css & code part