Skip to content

Commit

Permalink
⚡️ const type text map
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Dec 19, 2023
1 parent 6f0a264 commit c634fcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/src/block_syntaxes/alert_block_syntax.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ class AlertBlockSyntax extends BlockSyntax {
);

// Mapping the alert title text.
final titleText = {
const typeTextMap = {
'note': 'Note',
'tip': 'Tip',
'important': 'Important',
'caution': 'Caution',
'warning': 'Warning',
}[type]!;
};
final titleText = typeTextMap[type]!;
final titleElement = Element('p', [Text(titleText)])
..attributes['class'] = 'markdown-alert-title';
final elementClass = 'markdown-alert markdown-alert-${type.toLowerCase()}';
Expand Down

0 comments on commit c634fcf

Please sign in to comment.