language code not dispalying when viewing the node

Created on 12 September 2024, 4 months ago
Updated 17 September 2024, 3 months ago

Problem/Motivation

I was configuring Highlight.js module and I see the language code is not displayed when I view the node. It works completely fine when viewing in the CK editor. I saw a issue having the same problem - https://www.drupal.org/project/highlightjs_input_filter/issues/3414090 🐛 Last input filter on the page dictates the languages Fixed . Took the latest update this morning. But It didn't help.

Steps to reproduce

Install and enable the module
goto admin->config->Text formats and editors
edit Basic HTML and Full HTML
add code block in CKeditor and language code(eg: c|C, csharp|C#)
when adding a new node along with code block, this works as expected. The language code is shown in the CKeditor, However, The language is not shown when viewing the node.

Proposed resolution

The language code should be shown when viewing the node

Remaining tasks

none

User interface changes

none

API changes

none

Data model changes

none

🐛 Bug report
Status

Closed: works as designed

Version

1.1

Component

Code

Created by

🇮🇳India madhukar k Karnataka

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @madhukar k
  • Status changed to Closed: works as designed 3 months ago
  • 🇺🇸United States nmangold United States

    The language showing in CKEditor is functionality provided by CKEditor. That library is attached to the admin theme. Not the frontend theme. This module will not provide such functionality. You could potentially copy that functionality from CKEditor to your frontend theme, or implement Highlight.js Language Display plugin, as potential solutions.

    The other issue mentioned, 3414090, is not related to this request. That issue was related to using several body fields on the same page, for example, and the last body field dictating which language code blocks get highlighted on the page.

    I am closing this as works as designed.

  • 🇮🇳India madhukar k Karnataka

    Thanks @nmangold for your valuable comments - I'm checking more on Highlight.js Language Display plugin,

Production build 0.71.5 2024