badges icon indicating copy to clipboard operation
badges copied to clipboard

[FR] Simple Syntax for Native Supported Types

Open ninokierulf opened this issue 1 year ago • 0 comments

[!NOTE] TL;DR: allow simple syntax for native supported badges (those defined in constants.ts) Example: [!!SUCCESS] test case: given foo when bar then baz

Simplify Badge Syntax for Native Supported Types

Summary

Propose simplifying the badge syntax for natively supported badge types (as defined in constants.ts) by removing redundant key-value pairs.

Current Behavior

Currently, badges require a key-value syntax where both represent the same thing:

- `[!!success:SUCCESS]` test case: given foo when bar then baz

The key is case-insensitive, as demonstrated by these valid examples:

  • [!!success:SUCCESS]
  • [!!SUCCESS:SUCCESS]
  • [!!Success:SUCCESS]

Proposed Change

Allow a simplified syntax that uses a single value:

- `[!!SUCCESS]` test case: given foo when bar then baz

Benefits

  1. Cleaner, more concise syntax
  2. More readable when viewing raw markdown without the Badges plugin
  3. Maintains case-insensitive support ([!!SUCCESS], [!!Success], [!!success] would all be valid)

The displayed text would use the case styling provided in the badge declaration.

ninokierulf avatar Jan 03 '25 02:01 ninokierulf