githuber-md icon indicating copy to clipboard operation
githuber-md copied to clipboard

JavaScript string literals are not supported in code blocks

Open ColinKerr opened this issue 6 years ago • 2 comments

Any issue will be ignored if you don't provide the following detailed information.

Describe the bug If you create a code block with js string literals the '`'s are not properly formatted in the output. JS literals: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Example code block:

console.log(`1 and 1 make 2`);

Output code block: console.log(1 and 1 make 2);

To reproduce

Steps to reproduce the behavior:

  1. create a new post
  2. create a new javascript code block
  3. enter the line: console.log(1 and 1 make 2);
  4. publish

I have syntax highlighting by Prism.js enabled using coy theme. I have tried turning on/off various other settings and the bug still happens.

Expected behavior

Ideally literal strings would be correctly formatted including special formatting for expressions in the strings (See functionality listed here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)

At minimum literal strings should be treated like regular strings.

Screenshots

Expected: image

Actual: image

Server environment

  • WordPress version: 5.2.3
  • WP Githuber MD plugin version: 1.11.8

User environment

  • OS: Windows
  • Browser: Firefox (also tested on Chrome)

ColinKerr avatar Oct 14 '19 18:10 ColinKerr

I also encountered the same problem.

sanjusss avatar Oct 15 '19 02:10 sanjusss

I will take a look at it. If there is any update, I will mention you here.

terrylinooo avatar Oct 15 '19 02:10 terrylinooo

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] avatar Jun 30 '23 00:06 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jul 02 '23 00:07 github-actions[bot]