Giter Site home page Giter Site logo

Resolve deprecations about dom HOT 12 CLOSED

g105b avatar g105b commented on July 28, 2024
Resolve deprecations

from dom.

Comments (12)

glo71317 avatar glo71317 commented on July 28, 2024 1

@g105b Thanks lot for quick reply!

I will have a look and will update you tomorrow.

from dom.

g105b avatar g105b commented on July 28, 2024 1

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.

glo71317 avatar glo71317 commented on July 28, 2024 1

Great and Thanks to you for understanding!

from dom.

g105b avatar g105b commented on July 28, 2024

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.

glo71317 avatar glo71317 commented on July 28, 2024

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.

g105b avatar g105b commented on July 28, 2024

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.

glo71317 avatar glo71317 commented on July 28, 2024

@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.

g105b avatar g105b commented on July 28, 2024

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.

g105b avatar g105b commented on July 28, 2024

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.

glo71317 avatar glo71317 commented on July 28, 2024

@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.

glo71317 avatar glo71317 commented on July 28, 2024

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"
Screenshot 2023-07-24 at 7 10 37 PM
Screenshot 2023-07-24 at 7 08 54 PM

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.

g105b avatar g105b commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.