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

How could I to highlight code blocks in Scully?

I'm creating a blog with Scully and looking for a good way to setup code highlight there. for example, such block of code(with defining the language): ```typescript @NgModule({ declarations: [BlogComponent], imports: [CommonModule,…
Stepan Suvorov
  • 25,118
  • 26
  • 108
  • 176
0
votes
2 answers

Toolbar not created after navigating to second page in Prism.js

I am using the "Toolbar" and "Copy To Clipboard" plugins with PrismJS to display a code snippet and a toolbar button to copy the code to clipboard and am loading my Prism js and css files in my . PrismJS works as expected if I start directly…
av0000
  • 1,917
  • 6
  • 31
  • 51
0
votes
1 answer

Add additional syntax highlighter plugin to PrismJS in HCL Connections 6.5 CR1 TinyMCE

I installed the TinyMCE editor on top of a fresh Connections 6.5.1 installation. While syntax highlighting using the codesample plugin is enabled out of the box, it works only for certain languages. I found the codesample_languages, which were…
Lion
  • 16,606
  • 23
  • 86
  • 148
0
votes
1 answer

Prismjs syntax highlighting in a MEVN stack

I am working on a blog using a MEVN stack where I use the tiny-mce-vue editor. Now, all working great except if I add some code sample, they don't retain the syntax highlighting outside of the editor see screenshot: I have been surfing the web a…
Dragod83
  • 2,127
  • 3
  • 17
  • 20
0
votes
0 answers

How to display code from JavaScript file in HTML

I am trying to build a site where I show general JavaScript code snippets for various scenarios. I want to show the code from selected JavaScript file inside HTML ( not execute, just show ). I tried loading file using jQuery load…
Maxx32
  • 25
  • 5
0
votes
0 answers

Why are some languages not highlighted in an npm project using PrismJS?

I'm using Spectacle 5 in an npm project, which itself uses Prism as a dependency. The CodePane component correctly highlights code for e.g. python, but for e.g. haskell, no highlighting is being performed (I verified the same code snippet worked at…
bbarker
  • 11,636
  • 9
  • 38
  • 62
0
votes
0 answers

How to store blog posts's code examples in mongoDB and keep the indentation and line breaks?

I'm building a tech blog that has code examples in the articles using Angular, Node.js and MongoDB, I'm storing the post bodies in an html format. When I store a post the code snippets indentations and line breaks are being replaced by whitespaces.…
sabrina
  • 41
  • 3
0
votes
1 answer

Could someone explain what I am doing wrong in trying to create syntax highlighting for my website?

I'm trying really hard to add syntaxing highlighting for my personal website where I refer back to for concepts I have learnt. At first, to record my notes, I used Markdown, since that was pretty easy to take notes in. But as I explored more and…
herophant
  • 642
  • 7
  • 16
0
votes
1 answer

React markdown code highlight not working after changing route

I use react-markdown library and prismjs for highlighting code in my project. But the highlighting doesn't working always after I change route. For example, I have markdown code in TestPage, and the url path in browser is localhost:3000/test.…
Gasin
  • 51
  • 2
  • 7
0
votes
1 answer

Django puts spaces in first Line of TextField

I'm creating a webapp where I can present a documentation. In my documentations I often have some code snippets so I used prism (https://prismjs.com/) to format the text I enter in a textfield on the admin page. The Problem is that whenever I enter…
Janik Spies
  • 399
  • 7
  • 15
0
votes
0 answers

how to fix copy in prism.js when i add ngAfterViewChecked

I tried to copy the code but doesn't work. I'm using prism.js but when i use ngAfterViewChecked the copy does'nt work anymore. when I add in my component : public ngAfterViewChecked(): void { if (!this.highlighted) { …
koukou
  • 23
  • 6
0
votes
1 answer

Rendering code with syntax highlighting from a CMS

I am using a headless CMS(Strapi) and React on the frontend. I would like to render code blocks with highlighting using PrismJS (or anything). In my render():
  {`p { color: red }`}
 
RonE
  • 404
  • 6
  • 18
0
votes
0 answers

Scroll drag on Safari, what's that?

Open the following on Safari and Chrome or Firefox. https://prismjs.com/plugins/data-uri-highlight/ Now scroll right/left on the code sample. Did you notice it? Kind of a drag? What is that? Is it a thing of prismjs? I mean, where should I change…
KcFnMi
  • 5,516
  • 10
  • 62
  • 136
0
votes
0 answers

RAILS Prism gem only highlights codesample from direct URL or when refreshing page

I am using the prism gem and it highlights great but only from a direct URL or after refreshing the page. It does not highlight if navigating from the home page. Any suggestions? Thanks!
0
votes
2 answers

Angular - styles being ignored/overwritten

I'm having an issue with styles not being applied to elements. If I add style information to the component's styles parameter, or provide a CSS file in the styleUrls parameter, I get the expected results. However, inline HTML styles are not being…
Tyler Gray
  • 11
  • 4
1 2 3
8
9