Skip to content

Commit

Permalink
fix(code): remove language class, it aint working chief
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Feb 10, 2024
1 parent 2b07543 commit 325d188
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/core/src/components/discord-code/DiscordCode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { consume } from '@lit/context';
import { css, html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { messagesLightTheme } from '../discord-messages/DiscordMessages.js';
import type { LightTheme } from '../../types.js';

Expand Down Expand Up @@ -86,15 +85,6 @@ export class DiscordCode extends LitElement implements LightTheme {
@property({ type: Boolean, reflect: true })
public accessor embed = false;

/**
* The language of the code snippet.
*
* Setting this property will add a class "language-<language>" to the `code` element
* which can get styled by a library such as [Prism](https://prismjs.com/).
*/
@property()
public accessor language: string | undefined = undefined;

protected override willUpdate() {
if (this.parentElement && 'lightTheme' in this.parentElement) {
const parent = this.parentElement as { lightTheme: boolean };
Expand All @@ -105,7 +95,7 @@ export class DiscordCode extends LitElement implements LightTheme {
protected override render() {
if (this.multiline) {
return html`<discord-pre ?embed=${this.embed}
><code class="${ifDefined(this.language ? `language-${this.language}` : undefined)}"><slot></slot></code
><code><slot></slot></code
></discord-pre>`;
}

Expand Down

0 comments on commit 325d188

Please sign in to comment.