PrismJS / PrismJS/prism

cpp single quotes in double quoted string causes crash (when prism-cpp is used in docsify)

Open
#3,866 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: latest
  • Plugins: none
  • Environment: docsify

Description
When using a codeblock with cpp code:

It trips over singlequotes ('') that are inside of a double quoated ("") strings

Docsify plugin error TypeError: y.next.value is null.

Example

if(modem.mqttSubscribe("waltertopic")) {
    ESP_LOGI("mqtt", "subscribed to topic 'waltertopic'");
} else {
    ESP_LOGI("mqtt", "subscribe failed");
}

This is an example codeblock

Note
I have not tested if this behaviour is the same when used outside of docsify, although I can confirm it is prism-cpp that is causing the error.

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 by reproducing the provided C++ code block through prism-cpp in the docsify environment, then compare its behavior outside docsify as suggested. Trace the handling of single quotes inside the double-quoted strings; done means the example is highlighted without the TypeError: y.next.value is null crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.