really not sure how they managed to screw up displaying text, but they did
this post finally made me go and look a little closer at what's going on. i have been pissed off at the new github code viewer for weeks, because it has two very bad features:
- if i click the code, it creates a blinking cursor
- if i click the code, it jumps the page around for no fucking reason
- if i select code, it usually jumps the page around and removes my selection for no fucking reason
so it turns out the code view is two parts: a <textarea> which is used to select the text and get events to understand what the user is clicking/selecting, and what i can only describe as a "character canvas", because it is filled with thousands of empty <span> elements that specify the styling rules, along with a data-code-text="b" attribute and a ::before rule that specifies content: attr(data-code-text), thus making this styled version completely unselectable. i think the styled character canvas is positioned on top of the textarea, which explains all the bizarre font rendering issues i keep seeing.
i have learned all this because i was hopeful that getting rid of the <textarea> which drives all the things that drive me insane would make the website normal, but, no, unfortunately, there is a sea of tens of thousands of deliberately-unselectable single-character spans littering the DOM instead.
github drives me up the wall and i wish i could stop using it. unfortunately i am employed at a company that is using a lot of its value-add that would be hard to replace with another system. shit fucking sucks!
