cgiffard / Downsize

Tag safe text truncation for HTML and XML!
BSD 3-Clause "New" or "Revised" License
41 stars 13 forks source link

removing xregexp #30

Open mansona opened 6 years ago

mansona commented 6 years ago

Hi there 👋

I needed to remove the xregexp dependency because I am running downsize in the browser, this is an entirely nieve implementation but it seems to work reasonably well 🎉

There are 2 tests failing, stuff to do with unicode which is why I assume you were using XRegExp 😂

I'm opening this PR to start the discussion, let me know if you have any thoughts 👍

mansona commented 6 years ago

Hi there 👋 I got this working in the end relying on the default unicode support the JS platform. Essentially it amounts to a situation where it will support unicode if your environment supports http://node.green/#ES2018-features--RegExp-Unicode-Property-Escapes

I have also skipped 2 tests that have been broken because of my simplification of the overall system and the removal of XRegexp.

Let me know if you have any questions.