Bug / React code not working with Enlighter #379

Open
opened 2024-03-06 20:37:43 +01:00 by samir-ch-2010 · 2 comments
samir-ch-2010 commented 2024-03-06 20:37:43 +01:00 (Migrated from github.com)

WordPress Version

6.4.3

Enlighter Version

4.6.1

Editing method

Gutenberg Blocks

What happened?

Getting error: "The response is not a valid JSON response." with the following piece of react code.

export default function Button() {
function handleClick() {
alert('Button clicked!');
}

return (
); }

What browsers are you seeing the problem on?

Chrome

Your settings (debug)

{
    "translation-enabled": true,
    "enlighterjs-init": "inline",
    "enlighterjs-assets-js": true,
    "enlighterjs-assets-themes": true,
    "enlighterjs-assets-themes-external": true,
    "enlighterjs-selector-block": "pre.EnlighterJSRAW",
    "enlighterjs-selector-inline": "code.EnlighterJSRAW",
    "enlighterjs-indent": 2,
    "enlighterjs-ampersandcleanup": true,
    "enlighterjs-linehover": true,
    "enlighterjs-rawcodedbclick": false,
    "enlighterjs-textoverflow": "scroll",
    "enlighterjs-linenumbers": false,
    "enlighterjs-theme": "wpcustom",
    "enlighterjs-retaincss": false,
    "enlighterjs-language": "generic",
    "toolbar-visibility": "default",
    "toolbar-button-raw": true,
    "toolbar-button-copy": true,
    "toolbar-button-window": false,
    "toolbar-button-enlighterjs": false,
    "tinymce-backend": true,
    "tinymce-frontend": false,
    "tinymce-formats": true,
    "tinymce-autowidth": false,
    "tinymce-tabindentation": false,
    "tinymce-keyboardshortcuts": false,
    "tinymce-font": "sourcecodepro",
    "tinymce-fontsize": "0.7em",
    "tinymce-lineheight": "1.4em",
    "tinymce-color": "#000000",
    "tinymce-bgcolor": "#f9f9f9",
    "gutenberg-backend": true,
    "quicktag-backend": false,
    "quicktag-frontend": false,
    "quicktag-mode": "html",
    "shortcode-mode": "disabled",
    "shortcode-inline": true,
    "shortcode-type-generic": true,
    "shortcode-type-language": true,
    "shortcode-type-group": false,
    "shortcode-filter-content": true,
    "shortcode-filter-excerpt": true,
    "shortcode-filter-widget": false,
    "shortcode-filter-comment": false,
    "shortcode-filter-commentexcerpt": false,
    "gfm-enabled": false,
    "gfm-inline": true,
    "gfm-language": "raw",
    "gfm-filter-content": true,
    "gfm-filter-excerpt": true,
    "gfm-filter-widget": false,
    "gfm-filter-comment": false,
    "gfm-filter-commentexcerpt": false,
    "compat-enabled": false,
    "compat-crayon": false,
    "compat-codecolorer": false,
    "compat-type1": false,
    "compat-type2": false,
    "compat-filter-content": true,
    "compat-filter-excerpt": true,
    "compat-filter-widget": false,
    "compat-filter-comment": false,
    "compat-filter-commentexcerpt": false,
    "cache-custom": false,
    "cache-path": "",
    "cache-url": "",
    "dynamic-resource-invocation": true,
    "ext-infinite-scroll": false,
    "jetpack-gfm-code": false,
    "ext-ajaxcomplete": false,
    "bbpress-shortcode": false,
    "bbpress-markdown": false
}

I've read the docs/troubleshooting guidelines

  • I confirm that i've completely read and followed the troubleshooting guide!

The bug/issues appears in a clean WordPress environment

  • I confirm that the bug/issues happens within a clean WordPress enviroment!
### WordPress Version 6.4.3 ### Enlighter Version 4.6.1 ### Editing method Gutenberg Blocks ### What happened? Getting error: "The response is not a valid JSON response." with the following piece of react code. export default function Button() { function handleClick() { alert('Button clicked!'); } return ( <button onClick={handleClick}> Click me </button> ); } ### What browsers are you seeing the problem on? Chrome ### Your settings (debug) ```raw { "translation-enabled": true, "enlighterjs-init": "inline", "enlighterjs-assets-js": true, "enlighterjs-assets-themes": true, "enlighterjs-assets-themes-external": true, "enlighterjs-selector-block": "pre.EnlighterJSRAW", "enlighterjs-selector-inline": "code.EnlighterJSRAW", "enlighterjs-indent": 2, "enlighterjs-ampersandcleanup": true, "enlighterjs-linehover": true, "enlighterjs-rawcodedbclick": false, "enlighterjs-textoverflow": "scroll", "enlighterjs-linenumbers": false, "enlighterjs-theme": "wpcustom", "enlighterjs-retaincss": false, "enlighterjs-language": "generic", "toolbar-visibility": "default", "toolbar-button-raw": true, "toolbar-button-copy": true, "toolbar-button-window": false, "toolbar-button-enlighterjs": false, "tinymce-backend": true, "tinymce-frontend": false, "tinymce-formats": true, "tinymce-autowidth": false, "tinymce-tabindentation": false, "tinymce-keyboardshortcuts": false, "tinymce-font": "sourcecodepro", "tinymce-fontsize": "0.7em", "tinymce-lineheight": "1.4em", "tinymce-color": "#000000", "tinymce-bgcolor": "#f9f9f9", "gutenberg-backend": true, "quicktag-backend": false, "quicktag-frontend": false, "quicktag-mode": "html", "shortcode-mode": "disabled", "shortcode-inline": true, "shortcode-type-generic": true, "shortcode-type-language": true, "shortcode-type-group": false, "shortcode-filter-content": true, "shortcode-filter-excerpt": true, "shortcode-filter-widget": false, "shortcode-filter-comment": false, "shortcode-filter-commentexcerpt": false, "gfm-enabled": false, "gfm-inline": true, "gfm-language": "raw", "gfm-filter-content": true, "gfm-filter-excerpt": true, "gfm-filter-widget": false, "gfm-filter-comment": false, "gfm-filter-commentexcerpt": false, "compat-enabled": false, "compat-crayon": false, "compat-codecolorer": false, "compat-type1": false, "compat-type2": false, "compat-filter-content": true, "compat-filter-excerpt": true, "compat-filter-widget": false, "compat-filter-comment": false, "compat-filter-commentexcerpt": false, "cache-custom": false, "cache-path": "", "cache-url": "", "dynamic-resource-invocation": true, "ext-infinite-scroll": false, "jetpack-gfm-code": false, "ext-ajaxcomplete": false, "bbpress-shortcode": false, "bbpress-markdown": false } ``` ### I've read the docs/troubleshooting guidelines - [X] I confirm that i've completely read and followed the troubleshooting guide! ### The bug/issues appears in a clean WordPress environment - [X] I confirm that the bug/issues happens within a clean WordPress enviroment!
samir-ch-2010 commented 2024-03-06 20:41:16 +01:00 (Migrated from github.com)

Please use the following piece of code:

export default function Button() {
  function handleClick() {
    alert('Button clicked!');
  }

  return (
    <button onClick={handleClick}>
      Click me
    </button>
  );
}
Please use the following piece of code: ``` export default function Button() { function handleClick() { alert('Button clicked!'); } return ( <button onClick={handleClick}> Click me </button> ); } ```
AndiDittrich commented 2024-03-08 09:39:18 +01:00 (Migrated from github.com)

i cannot confirm this issue within a clean environment. please provide the steps to reproduce the issue within a clean wordpress installation

i cannot confirm this issue within a clean environment. please provide the steps to reproduce the issue within a clean wordpress installation
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
EnlighterJS/Plugin.WordPress#379
No description provided.