Hyunbin

I have noticed that Twitter has converted Array.prototype.at into a blue, clickable hyperlink. This is because prototype.at is a valid domain and URL.

Array.prototype.at text in a tweet is converted into a hyperlink

Not all words connected with . are converted into hyperlinks. The last word should be a valid top-level domain (TLD). The problem is that there are many valid TLDs. In fact, .ninja, .contact, .pictures are all valid TLDs.

Twitter conveted hyunbin.ninja into a link (but not hyunbin.idk)

To disable automatic hyperlinks, simply add a ZWSP(zero width space) after a . or @. The unicode code point is U+200B, and the symbol can be copied from these websites — unicode-table, unicode-explorer, unicode-symbol.

Adding a ZWSP after . and @ disabled automatic hyperlinks.

--

--

VS Code themes can italicize certain text. For example, Cobalt2 italicizes all comment text. One exception is the | symbol in macOS environment, which greatly improves table legibility. (Yes, I use markdown tables in comments.)

--

--

Similarities

Function returned from onMount and callback passed to onDestroy are both called before a Svelte component is unmounted(destroyed).

If a function is returned from onMount, it will be called when the component is unmounted. — onMount, Svelte Docs

Therefore, they can be used to clear intervals or remove event listeners.

Schedules a callback to run immediately before the component is unmounted. — onDestroy, Svelte Docs

Difference

onDestroy runs inside a server-side component. This affects SSR(server-side-rendering). Therefore in SvelteKit, it is advised to clear intervals and remove event listeners using onMount instead.

Out of onMount, beforeUpdate, afterUpdate and onDestroy, this is the only one that runs inside a server-side component. — onDestroy, Svelte Docs

--

--

Hyunbin

Hyunbin

Node.js and web developer using TypeScript. Undergraduate in Seoul National University.