Class MarkdownFeature

java.lang.Object
software.bluelib.markdown.MarkdownFeature
Direct Known Subclasses:
Bold, Color, Hyperlink, Italic, Spoiler, Strikethrough, Underline

public abstract class MarkdownFeature extends Object
A public abstract class for handling Markdown formatting features.

Purpose: This class applies specific formatting to the content of a MutableComponent based on the feature's prefix and suffix. It handles both plain text and components with siblings.
When: The Markdown formatting is applied when the apply(MutableComponent) method is called.
Where: The formatting is applied to the content of the component and its siblings, if any.
Additional Info: This class supports handling different types of Markdown features (e.g., bold, italic) and can process both single text and text with components.

Key Methods:
Since:
1.1.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The prefix for the Markdown feature.
    protected String
    The suffix for the Markdown feature.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    appendFormattedText(String pText, net.minecraft.network.chat.Style pStyle, net.minecraft.network.chat.MutableComponent pResult)
    Appends formatted text to a component.
    protected void
    appendUnstyledText(String pText, net.minecraft.network.chat.MutableComponent pResult, net.minecraft.network.chat.Style pOriginalStyle)
    Appends unstyled text to a component.
    net.minecraft.network.chat.MutableComponent
    apply(net.minecraft.network.chat.MutableComponent pComponent)
    Applies the Markdown feature to the provided component.
    protected abstract String
    Gets the name of the feature.
    protected abstract boolean
    Checks if the feature is enabled.
    protected void
    processComponentText(String pText, net.minecraft.network.chat.Style pOriginalStyle, net.minecraft.network.chat.MutableComponent pResult, Pattern pPattern, BiConsumer<Matcher,net.minecraft.network.chat.MutableComponent> pSpecialTextHandler)
    Processes the text of a component using Markdown formatting.
    protected void
    processComponentTextWithFormatting(String pText, net.minecraft.network.chat.Style pOriginalStyle, net.minecraft.network.chat.MutableComponent pResult, Pattern pPattern)
    Processes the text of a component with Markdown formatting applied.
    protected net.minecraft.network.chat.MutableComponent
    processSiblings(net.minecraft.network.chat.MutableComponent pComponent, Pattern pPattern, QuadConsumer<String,net.minecraft.network.chat.Style,net.minecraft.network.chat.MutableComponent,Pattern> pSiblingProcessor)
    Processes the siblings of a component with Markdown formatting.
    protected net.minecraft.network.chat.MutableComponent
    processSiblingsWithFormatting(net.minecraft.network.chat.MutableComponent pComponent, Pattern pPattern)
    Processes the siblings of a component with specific Markdown formatting applied.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait