Dennis Snell

460 posts

Dennis Snell

Dennis Snell

@dmsnell23

Katılım Aralık 2013
93 Takip Edilen341 Takipçiler
Dennis Snell
Dennis Snell@dmsnell23·
@brendt_gd Talking about HtmlDocument? DOMDocument is full of security holes, corruption, and cannot parse HTML (only XML). WordPress’ HTML API was built as a performant, streaming, compliant HTML parser easy to embed without WordPress. Happy to chat if you are interested.
English
0
0
0
9
Brent
Brent@brendt_gd·
So, I may have to write a new HTML parser because PHP's built-in one is too strict. (It follows the spec just fine, it's just that tempest/view adds on top of HTML, and the parser can't deal with it). How hard could it be?
English
10
0
27
7.9K
Dennis Snell retweetledi
WPLift
WPLift@wplift·
🌊 "We're so used to WordPress development being a drop in a massive ocean, but with Playground, *we are* the ocean. We get to choose everything that goes out to our customers," said @dmsnell23, sharing unique opportunities with Playground at #WCUS. 💻✨ #WordPress #PlayGround
English
0
2
2
338
Dennis Snell
Dennis Snell@dmsnell23·
@laxmariappan @phpcampers Thanks for clarifying. Exciting stuff coming soon in the HTML Processor, doing what PHP 8.4's Dom\HTMLDocument won't even be able to do: fully isolate inner HTML
English
0
0
1
21
Lax Mariappan
Lax Mariappan@laxmariappan·
@dmsnell23 @phpcampers The meme was intended to pique curiosity. I'm glad it got noticed by you! Your examples are great, adding them to the list of resources.
English
1
0
1
20
Dennis Snell
Dennis Snell@dmsnell23·
Even spec-compliant #html parsers can "break." HTML cannot represent all possible (even invalid) DOM trees. #wordpress' #htmlapi speaks HTML and ensures full encapsulation and isolation when manipulating a document so this doesn't happen.
Dennis Snell tweet media
English
0
0
2
127
Dennis Snell
Dennis Snell@dmsnell23·
You can't parse #HTML with #XML. Because HTML can't be parsed by XML. XML is not a tool that can be used to correctly parse HTML. The use of XML will not allow you to consume HTML. XML is a tool that is insufficiently sophisticated. Have you tried using an HTML parser instead?
English
0
0
1
110
Dennis Snell
Dennis Snell@dmsnell23·
@HowellsMead @nickmdiego It's a repurposed XML parser (cannot parse HTML properly) and unaware of HTML's rules. it's vulnerable to many attacks based on these omissions. it detects tags inside TEXTAREA, it's missing hundreds of character references, unaware of TEMPLATEs, removes content, and much more.
English
0
0
0
41
Nick Diego
Nick Diego@nickmdiego·
Building block extensions in WordPress can be a lot of fun. Here's my latest experiment, linked Group blocks. ✨ How I built it, the code, and a Playground demo are available here: nickdiego.com/enabling-linke…
English
9
16
82
9.5K
Dennis Snell
Dennis Snell@dmsnell23·
SGML lets me write post tags the way I think about them, and with a proper ENTITY and SHORTREF+USEMAP, it parses them structurally. #sgml
Dennis Snell tweet mediaDennis Snell tweet mediaDennis Snell tweet media
English
0
0
0
95
Dennis Snell
Dennis Snell@dmsnell23·
@rossmorsali @stevejonesdev @nickmdiego @BlockVisibility oh I could totally see that adding latency. we're exploring adding a final HTML-processing pass in WordPress. also: the HTML API doesn't _yet_ extend documents but it's designed to stream, meaning output buffering with a callback and no additional latency.
English
0
0
1
69
Ross Morsali
Ross Morsali@rossmorsali·
@dmsnell23 @stevejonesdev @nickmdiego @BlockVisibility Up against a deadline but I'll open a ticket with test case after - I've set a reminder. My exp was that it added around 200ms of overhead, but I was parsing fully rendered pages after capturing the content with output buffering, which I don't think is the standard use case :/
English
1
0
1
56
Nick Diego
Nick Diego@nickmdiego·
Sitting on an airplane deleting incomprehensible regex in @BlockVisibility and using the WordPress HTML API instead. Continually amazed by this API. 42 → 7 lines of code 🤯
English
8
2
50
2K
Dennis Snell retweetledi
Milana Cap (#WCEU & #WPDDNS organiser)
Did you know that HTML API is built from 0, specially for #WordPress, and there's no other framework or CMS that has anything similar? They all still use regex 🥲 There's also an interesting effect on performance 👯 I'll show you its magic in two weeks at @PHPSrbija #PHPSRB 🥰
English
1
1
5
251