Feat/minimessage tags - #399
Conversation
- introduce SmallCapsTag to convert text to small caps using toSmallCaps function - update miniMessage method to include new "small" tag for text formatting - enhance smallCapsMap visibility by changing it to internal
- introduce SmallCapsTag to convert text to small caps using toSmallCaps function - update miniMessage method to include new "small" tag for text formatting - enhance smallCapsMap visibility by changing it to internal
There was a problem hiding this comment.
Pull request overview
Adds new MiniMessage tags to the core Surf API MiniMessage holder to support additional themed formatting and a small-caps text transformation, plus bumps the project version.
Changes:
- Register a new
<note>color tag backed byColors.NOTE. - Add a new
<small>MiniMessage tag intended to render text in small caps viatoSmallCaps(). - Bump
versionfrom3.33.4to3.33.5.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| surf-api-core/surf-api-core/src/main/kotlin/dev/slne/surf/api/core/minimessage/SurfMiniMessageHolder.kt | Adds <note> color tag and a <small> modifying tag (small caps). |
| gradle.properties | Bumps project version to 3.33.5. |
Comments suppressed due to low confidence (2)
surf-api-core/surf-api-core/src/main/kotlin/dev/slne/surf/api/core/minimessage/SurfMiniMessageHolder.kt:106
SmallCapsTag.applyclearschildrenfor bothTextComponentand non-TextComponentnodes. This will drop nested components produced by other tags (e.g., styles/gradients/hover/click content represented as children) and can change message structure unexpectedly. The modifier should generally preserve children and only adjust the current node’s text content when applicable.
if (current is TextComponent) {
return current.content(current.content().toSmallCaps())
.children(emptyList())
}
return current.children(emptyList())
surf-api-core/surf-api-core/src/main/kotlin/dev/slne/surf/api/core/minimessage/SurfMiniMessageHolder.kt:82
- A new
<small>tag is registered, but it isn’t documented in the KDoc “Available Custom Tags” section. Please add it (and what it does) so consumers can discover it.
tagBuilder.tag("small") { _, _ -> SmallCapsTag() }
}
|
Tick the box to add this pull request to the merge queue (same as
|
|
No description provided.