PrismJS / PrismJS/prism

Highlighting working in TinyMCE, but not website

Open
#3,792 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13k
Forks
1.4k
Avg merge
15h 36m
Merged PRs (30d)
3

Description

Information:

  • Prism version: 1.29
  • Plugins: line hightlight, linenumbers, show language, inline color, toolbar, copy to clipboard button
  • Environment: Browser (Chrome)

I am using two systems: One is a manager that creates texts for the other system. The manager is built with Angular (TypeScript) and I managed to get Prism working in TinyMCE. I downloaded the JS and CSS (for the language C#) from the website and referenced them in my Angular application. The rest is pretty simple.
When I use the code plugin I see I can select C# and it's highlighted nicely in my TinyMCE. I submit the text with the C# code.

I go to the other website, the one for customers. This is a WordPress website and I made a custom plugin to retrieve and show the texts from the manager. I referenced the JS and HTML for prism again. Then I try to view the text with the code highlighting... Nothing.

image

I can see the class language-csharp in the pre element, followed by a code HTML element.

Am I missing something?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the WordPress custom plugin that retrieves and displays the text, and verify in Chrome that the referenced Prism JavaScript and CSS load on the customer website. Compare its rendered

...
markup with the working TinyMCE output; done means the customer site highlights the C# code.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, csharp, javascript, typescript, wordpress
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.