Skip to content

Commit

Permalink
fixed escaped content in buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
dogusata committed Nov 7, 2024
1 parent 0b36a57 commit 016aac2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Config } from '../helper/config';
import { cancelEvent } from '../helper/events';
import escapeHTML from 'escape-html';
import '../styles/components/_button.scss';
import unescapeHTML from 'unescape-html';

const TOOLTIP_DELAY = 350;
export interface ButtonProps {
Expand Down Expand Up @@ -106,7 +107,7 @@ class ButtonInternal extends ButtonAbstract {
if (typeof label !== 'string') {
return [ { type: 'span', classNames: [ 'mynah-button-label' ], children: [ label ] } ];
} else {
return [ { type: 'span', classNames: [ 'mynah-button-label' ], innerHTML: marked.parseInline(escapeHTML(label)) as string } ];
return [ { type: 'span', classNames: [ 'mynah-button-label' ], innerHTML: marked.parseInline(unescapeHTML(escapeHTML(label))) as string } ];
}
}
return [];
Expand Down

0 comments on commit 016aac2

Please sign in to comment.