Created
July 11, 2024 10:10
-
-
Save nul800sebastiaan/8caf7ab8d5e152029c2c998d60ca8f1b to your computer and use it in GitHub Desktop.
Code block with syntax highlighting on Discord
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```js | |
#onChange(event: InputEvent) { | |
if (event.target && event.target instanceof HTMLElement) { | |
const target = event.target; | |
const firstShadowRoot = target.shadowRoot; | |
if (firstShadowRoot) { | |
const umbInputDocument = firstShadowRoot.querySelector('umb-input-document'); | |
if (umbInputDocument && umbInputDocument.shadowRoot) { | |
const refList = umbInputDocument.shadowRoot.querySelector('uui-ref-list'); | |
if (refList) { | |
const id = refList.id; // Access the id of the uui-ref-list | |
console.log(id); // Use the id as needed | |
} | |
} | |
} | |
} | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
js
after the first 3 backticks, which will do Javascript syntax highlighting. Usingcsharp
instead would make it highlight C# code, and so on. A list of supported languages is available as well.