CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Author Topic: DOM to textContent, would you find it useful?  (Read 30 times)

Jason Knight

  • Administrator
  • Hero Member
  • *****
  • Posts: 736
  • Karma: +132/-1
    • CutCodeDown -- Minimalist Semantic Markup
DOM to textContent, would you find it useful?
« on: 7 Jul 2021, 11:47:17 am »
Because textContent and innerText are utterly unreliable and output the result willy-nilly cross-browser, I've got my own Element.__text method for the upcoming Elementals 5 that outputs a whitespace condensed and trimmed version of the textcontent of an element. Aka it's exactly how a browser would render non-preformatted text.

But I was thinking on making a more robust version more akin to innerText where block-level tags still get /r/n at the end of their content nodes, and maybe preserving UL/OL bullets...

At which point, I could probably make it parse to AND FROM markdown. So my question is would anyone find that useful enough to put it into the baseline library? It would probably end up another 3-4k of code, and I'm already butting heads with my hard-limit of 24k. (16.7k right now, gzipped around 6k)

This is funny, I hate markdown, but it would be a nice tribute to Aaron. We went round and round in circles arguing the pro's and cons of it. He'd be shocked to hear me coming around on the topic.
I'll fix every flaw, I'll break every law, I'll tear up the rulebook if that's what it takes. You will see, I will crush this cold machine.

 

SMF spam blocked by CleanTalk

Advertisement