Skip to content

Bug / Line Breaks in Code Blocks using Enlighter Plugin on Elementor #380

@lyc233nb

Description

@lyc233nb

WordPress Version

6.5.3

Enlighter Version

latest

Editing method

Text editor (e.g. comments) with pre tags

What happened?

Hello [Developer/Support Team],

I hope this message finds you well. I am reaching out to report an issue I’ve encountered while using the Enlighter plugin to display code blocks within Elementor on my WordPress site.

Problem Description:
When I format my code using the Enlighter plugin, it seems to be converted correctly in the text editor. However, upon viewing the page live, the line breaks in my code are replaced with
tags, disrupting the intended formatting of the code. Here's an example of how my code appears within the Elementor text editor:

/*
* This is a multi-line comment
*/

Expected Result:
The code should be displayed with proper line breaks and formatting when rendered on the website.

Actual Result:
The rendered code displays
tags where the line breaks should be, resulting in a cluttered code block.

Troubleshooting Steps Taken:

I have checked the Enlighter plugin settings for any line breaking/formatting options and adjusted them accordingly, but the issue persists.
I have made sure not to use the visual editor in Elementor after pasting my code into the text module to avoid any auto-formatting issues.
I am not sure whether this is related to a CSS conflict, JavaScript issue, or a misconfiguration within the plugin or Elementor. I would greatly appreciate any guidance or assistance you could provide in resolving this matter. Furthermore, if there is any additional information or access required to diagnose this issue, please let me know, and I'll be happy to comply.

Thank you for your time and assistance.

Best regards,
Yuchen Lu

What browsers are you seeing the problem on?

No response

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": 4,
    "enlighterjs-ampersandcleanup": true,
    "enlighterjs-linehover": true,
    "enlighterjs-rawcodedbclick": true,
    "enlighterjs-textoverflow": "scroll",
    "enlighterjs-linenumbers": true,
    "enlighterjs-theme": "enlighter",
    "enlighterjs-retaincss": false,
    "enlighterjs-language": "generic",
    "toolbar-visibility": "show",
    "toolbar-button-raw": true,
    "toolbar-button-copy": true,
    "toolbar-button-window": true,
    "toolbar-button-enlighterjs": true,
    "tinymce-backend": true,
    "tinymce-frontend": true,
    "tinymce-formats": true,
    "tinymce-autowidth": false,
    "tinymce-tabindentation": true,
    "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": true,
    "quicktag-frontend": true,
    "quicktag-mode": "html",
    "shortcode-mode": "modern",
    "shortcode-inline": false,
    "shortcode-type-generic": false,
    "shortcode-type-language": false,
    "shortcode-type-group": false,
    "shortcode-filter-content": false,
    "shortcode-filter-excerpt": false,
    "shortcode-filter-widget": false,
    "shortcode-filter-comment": false,
    "shortcode-filter-commentexcerpt": false,
    "gfm-enabled": true,
    "gfm-inline": false,
    "gfm-language": "generic",
    "gfm-filter-content": true,
    "gfm-filter-excerpt": true,
    "gfm-filter-widget": true,
    "gfm-filter-comment": false,
    "gfm-filter-commentexcerpt": false,
    "compat-enabled": true,
    "compat-crayon": true,
    "compat-codecolorer": false,
    "compat-type1": true,
    "compat-type2": true,
    "compat-filter-content": true,
    "compat-filter-excerpt": true,
    "compat-filter-widget": false,
    "compat-filter-comment": false,
    "compat-filter-commentexcerpt": false,
    "cache-custom": true,
    "cache-path": "",
    "cache-url": "",
    "dynamic-resource-invocation": true,
    "ext-infinite-scroll": false,
    "jetpack-gfm-code": false,
    "ext-ajaxcomplete": true,
    "bbpress-shortcode": true,
    "bbpress-markdown": true
}

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!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions