Copying Text (Markdown) - MeAlam1/BlueLib GitHub Wiki


Copying Text in Chat

Overview

While copying text is not a native feature in Markdown, BlueLib introduces a convenient method to copy text directly from chat. This feature allows players to click on text in the chat window to copy it to their clipboard, streamlining the process of sharing important information, codes, or messages in the game.


How It Works

To enable text copying in chat, simply click on the text, and it will be copied to the clipboard. This can be especially useful for sharing strings, commands, or other important data that players may need to paste elsewhere.


Important Notes

  • Priority of Click Events: If the text has an existing click event, such as a hyperlink, the hyperlink will take priority. In this case, clicking the text will trigger the hyperlink's action instead of copying the text.
  • Text Without Click Events: Only text without click events will trigger the copy action when clicked. If a clickable element (e.g., a hyperlink) is part of the text, the copy function will not be activated.
  • Text that gets Copied: The text will be copied before any styling was applied.

Example Scenario

Imagine you have a message with both a hyperlink and some plain text, like so:

Click here to visit our [website](https://example.com) or copy the text.

If you click on the link, it will open the website. However,

  • Will be Copied
  • Will not be Copied
    • "Click here to visit our website or copy the text."

Key Points

  • Click to Copy: Text without any click events will be copied when clicked.
  • Hyperlinks Take Priority: If the text has an active click event, such as a hyperlink, that event will be triggered instead of copying the text.

Note: Ensure that the text you want to copy doesn't conflict with other interactive elements like hyperlinks, as they will take precedence when clicked.

For more information or to provide feedback, join our Discord community.