Constants for language access

This commit is contained in:
Alexander Nozik 2023-01-09 11:24:11 +03:00
parent b11be7df2d
commit 92b031392a

View File

@ -56,13 +56,13 @@ internal val FortyDataRenderer: DataRenderer = object : DataRenderer {
override fun invoke(name: Name, data: Data<Any>) {
if (data.type == typeOf<HtmlFragment>()) {
data as Data<HtmlFragment>
val languageMeta: Meta = DataRenderer.buildLanguageMeta(name)
val languageMeta: Meta = Language.forName(name)
val dataMeta: Meta = if (languageMeta.isEmpty()) {
data.meta
} else {
data.meta.toMutableMeta().apply {
"languages" put languageMeta
Language.LANGUAGES_KEY put languageMeta
}
}