soranoo / next-css-obfuscator

A package deeply inspired by PostCSS-Obfuscator but for Next.js.
https://next-css-obfuscator.vercel.app
MIT License
71 stars 3 forks source link

Accidently obfuscated HTML tag #7

Closed soranoo closed 7 months ago

soranoo commented 7 months ago
          One more :)))) Sorry I'm so annoying just pointing out the bug without doing anything to help you 🥲.

👉 filter tag inside svg tag:

Screenshot 2024-02-01 005032

In the comments above, I had to put filter in classIgnore to not cause the filter tag to obfuscate, hmmm... I don't know why it detected filter tag as a class.

Screenshot 2024-02-01 005433

In conversion.json file:

Screenshot 2024-02-01 005736

OMG is it really a class 🤯? How.

Note: filter attribute was not changed ✅:

Screenshot 2024-02-01 010832

👉 Also with iframe tag:

Screenshot 2024-02-01 010014 Screenshot 2024-02-01 010221

I thought it was an element of HTML huh?

Screenshot 2024-02-01 010054

With <filter>:

Screenshot 2024-02-01 010346

Without <filter>:

Screenshot 2024-02-01 010400

Originally posted by @hoangnhan2ka3 in https://github.com/soranoo/next-css-obfuscator/issues/6#issuecomment-1919632415

soranoo commented 7 months ago

It seems filter is a valid Tailwind class. image

I don't see where the issue is. The key obfuscation regex works very well. image

hoangnhan2ka3 commented 7 months ago

yeah it's valid but I'm not use it yet and why it can replace the filter tag without className in front?

Maybe it's TW's or PostCSS's error huh

soranoo commented 7 months ago

May I have a piece of the HTML code(after compilation) with the filter in it?

hoangnhan2ka3 commented 7 months ago

U want a version with filter in classIgnore or not?

soranoo commented 7 months ago

The original version. (before obfuscation)

hoangnhan2ka3 commented 7 months ago

after compilation and before obfuscation, u mean I should turn off your package and deploy it,right?

hoangnhan2ka3 commented 7 months ago

wait for me @soranoo , I will share my project for u

soranoo commented 7 months ago

after compilation and before obfuscation, u mean I should turn off your package and deploy it,right?

yes

hoangnhan2ka3 commented 7 months ago

I just invited you @soranoo

The filter u want is in /src/app/not-found.tsx, check out .big and .small

soranoo commented 7 months ago

I can't reproduce the issue image

hoangnhan2ka3 commented 7 months ago

U mean u don't see this?

Screenshot 2024-02-01 005433

Try run build then run start or deploy it

Tell me if I need to make a clean npm i or uppdate somthing on your package

soranoo commented 7 months ago

I found you are in beta1

soranoo commented 7 months ago

Try update to beta2

npm i next-css-obfuscator@beta

hoangnhan2ka3 commented 7 months ago

yes, but...

Screenshot 2024-02-01 040534

let me try a clean npm i

hoangnhan2ka3 commented 7 months ago

Still nope

Screenshot 2024-02-01 041027

image

Screenshot 2024-02-01 041009

Let me deploy it, please check 404 page after few seconds.

hoangnhan2ka3 commented 7 months ago

ahh I know I know, please add to doc that user should/ must include

# css-obfucate
/css-obfuscator
/css-obfuscator/conversion.json

in the .gitignore file before deloy, otherwise it will get the data in the old css-obfuscator folder pushed to github:

image

hoangnhan2ka3 commented 7 months ago

Now you can go to hoangnhan.co.uk/404 to see the filter issue of .big and .small

hoangnhan2ka3 commented 7 months ago

I also used the same repo I just shared with you to deploy to hoangnhan.co.uk, I've just deleted the old css-obfuscator folder, please take a look to see if you can reproduce the error.

soranoo commented 7 months ago

Add the following to next-css-obfuscator.config.cjs

// next-css-obfuscator.config.cjs

contentIgnoreRegexes: [
   /\.jsxs\)\("\w+"/g
]
soranoo commented 7 months ago

I will add this to doc and default config

hoangnhan2ka3 commented 7 months ago

FIXED!

hoangnhan2ka3 commented 7 months ago

You are very fanstatic @soranoo , I think I can safely build the project. If there are any problems, I will create an issue later 💕.