diff --git a/src/Config.php b/src/Config.php index 4a988b3..812aed4 100644 --- a/src/Config.php +++ b/src/Config.php @@ -34,14 +34,24 @@ class Config implements ConfigInterface private ?LocaleInterface $defaultLocale; private string $idInterpolatorPattern; + /** + * @var array + */ + private array $defaultRichTextElements; + + /** + * @param array $defaultRichTextElements + */ public function __construct( LocaleInterface $locale, ?LocaleInterface $defaultLocale = null, + array $defaultRichTextElements = [], string $idInterpolatorPattern = IdInterpolator::DEFAULT_ID_INTERPOLATION_PATTERN ) { $this->locale = $locale; $this->defaultLocale = $defaultLocale; $this->idInterpolatorPattern = $idInterpolatorPattern; + $this->defaultRichTextElements = $defaultRichTextElements; } public function getDefaultLocale(): ?LocaleInterface @@ -58,4 +68,12 @@ public function getLocale(): LocaleInterface { return $this->locale; } + + /** + * @return array + */ + public function getDefaultRichTextElements(): array + { + return $this->defaultRichTextElements; + } } diff --git a/src/ConfigInterface.php b/src/ConfigInterface.php index aa9d6d2..17a2aa3 100644 --- a/src/ConfigInterface.php +++ b/src/ConfigInterface.php @@ -35,6 +35,27 @@ interface ConfigInterface */ public function getDefaultLocale(): ?LocaleInterface; + /** + * Returns a map of tag names to rich text formatting functions + * + * This is meant to provide a centralized way to format common tags such as + * ``, `

`, or enforcing a certain design system in the codebase + * (e.g., standardized ``, `