Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substitution filters break with line filters #2233

Open
OshidaBCF opened this issue Mar 3, 2024 · 2 comments
Open

Substitution filters break with line filters #2233

OshidaBCF opened this issue Mar 3, 2024 · 2 comments

Comments

@OshidaBCF
Copy link

I have two filters, one is a line filter "hp": \d*\.?\d* just to ignore and "hp" changes

the other is a filter to ignore an addition \n },\n "transmission": {\n "armorThrough": 50.0,\n "fireParamsPreset": "ship_engine",\n "armorClass": "armor_tank_engine",\n "armorThickness": 4.0,\n "fireProtectionHp": 10.0

image

The substitution filter is supposed to ignore the addition of the "transmission" block, but because the line just above is a "hp" change the different is actually larger

If i disable line filters this show up
image

And the comma isn't in the same difference as the "transmission" block

if i change the hp value to 760, the transmission filter works
image

i do not know exactly how it works, but i guess that both filters try to apply at the same time or on the same text, and it break somewhere

old.txt
new.txt

@sdottaka
Copy link
Member

sdottaka commented Mar 3, 2024

I haven't investigated the reason yet, but mixing Line filters and substitution filters may not work, so how about changing Line filter to Substitution filter as shown below?
In addition, in the current version, it was necessary to change \n in the second Substitution filter to \r\n for attached files.

image

@OshidaBCF
Copy link
Author

I tried by pure luck to change line to substitution, and it worked perfectly

i didn't needed to add the \r, maybe because i have the "Cariage return difference" turned off

i should start using only substitution, because they can work on multiple lines they are much stronger than regular line filters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants