Comments (12)
@g105b Thanks lot for quick reply!
I will have a look and will update you tomorrow.
from dom.
Great. Feel free to reach out whenever you need any help. I'd like to hear about your success too, not just anything negative 😄
Speak soon and have fun!
from dom.
Great and Thanks to you for understanding!
from dom.
There are many solutions online, but none of them seem to appreciate that some developers put 🌮 emoji 🥕 in their HTML, or even simple things like "Polski jest pięknym językiem".
My solution:
$html = mb_encode_numericentity(
$html,
[0x80, 0x10FFFF, 0, -1],
"UTF-8"
);
from dom.
Hello @g105b,
I hope you are doing good!
I have a query regarding this issue, there is any plan to fixed in upcoming near because we are planing to use latest version of "phpgt/dom" in magento side. In last release we have provided the fix for the same - #412 and you had released v2 new release and we are using "phpgt/dom":"^2.2.4".
Can you please have a look and help us in this regard?
from dom.
Hi @glo71317,
I'm doing great, thanks. Hope everything is going well with you too.
It's fantastic to hear Magento are switching to the latest version. There are plenty of nice new features, and performance increases since v2.
The issue #412 was fixed as a backport to v2 to support users of that version. There are tests covering multi-byte strings and unicode characters, and I've just added the specific mb_encode_numericentity
fix to the HTMLElement
class in a PR.
Please can you test your code with the 424-html-entities
branch (PR here), and please can you cast your attention to the escaped characters unit tests?
Let me know how you get on. If there's any tweaks the repository needs, please share your findings here and I'll happily apply any fixes to help you get on to the latest version.
from dom.
@g105b I have reviewed your PR changes, Changes are looks fine to me and also you can keep escaped characters unit tests which are required to test some scenarios.
I have one question regarding this change - https://github.com/PhpGt/Dom/blob/v4.1.2/src/HTMLDocument.php#L36 because we had delivered https://github.com/PhpGt/Dom/blob/v2.2.4/src/HTMLDocument.php#L35C1-L40 which is tested at our end properly.
Can you please confirm about this changes - https://github.com/PhpGt/Dom/blob/v4.1.2/src/HTMLDocument.php#L36 is tested at your end or not?
Note - Testing in progress with your PR changes, we are facing some issue once it will be complete i will notify you.
from dom.
The loadHTML functionality, with the flags LIBXML_SCHEMA_CREATE | LIBXML_COMPACT
have been tested for unicode/utf-8 support, but please see if you can find any edge cases that the unit tests are not covering. I can not find any cases where loading multibyte characters is escaped badly or malformed.
Keep me updated and have a good day.
from dom.
Hi @glo71317,
I've just made a new patch release to the library: https://github.com/PhpGt/Dom/releases/tag/v4.1.3
This includes the aforementioned PR, and some rather small changes.
Please feed back your experience with this release and I'll be here if you need me.
Cheers,
Greg.
from dom.
@g105b Thanks for releasing the new patch.
I am working on BIC issue after updating the latest version of "phpgt/dom". So it may required time to resolve.
Surely, i will catch you if any help will require.
Thanks,
Rajesh
from dom.
Hello @g105b
Greeting for the day!
I had tried to update the latest version- "phpgt/dom": "^4.1.3" which is released few days back.
When i am updating latest version, i am not able to update the latest version because dependency of "psr/http-message" changed from ^1.0 to ^2.0 in "phpgt/dom": "^4.1.3".
From Magento side, several third party dependency are using "psr/http-message": "^1.0"
So, i don't know it will be possible or not from your end.
if this dependency https://github.com/PhpGt/Dom/blob/v4.1.3/composer.json#L13, we can change e.g. "psr/http-message": "^1.0 || ^2.0" then it should be resolve the issue.
from dom.
Thanks for letting me know. There's nothing Dom relies on in 2.0 that can't be satisfied by 1.0, so I'll get that changed and make a patch release for you.
from dom.
Related Issues (20)
- Unicode characters and innerHTML
- PHP 7.4 compatibility HOT 1
- strip tags in inline script HOT 1
- Extend DOMDocument, rather than Facade HOT 1
- Deprecation warnings for 8.1 HOT 1
- Test HTMLSelectElement::options when using optgroup
- escaped characters HOT 18
- PHPStan lies about types within certain traits
- Updating an ID attribute via its Node causes getElementById to fail
- Dataset automatic camel case to hyphen key conversion HOT 1
- Dependabot
- NodeList::forEach HOT 1
- AllowDynamicProperties
- Can't user this anymore on PHP 7.4? HOT 3
- Dataset dynamic properties are not hyphen exploded properly
- Matrix builds & QA tools HOT 1
- PHP 8.2 introduces a bug where DOMElement::prepend does not retain same object reference
- querySelectorAll should return an array of Elements, not Nodes
- TextArea::value property
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dom.