share icon indicating copy to clipboard operation
share copied to clipboard

gamelist-cleaner.sh Fix for filenames with '&' not being removed

Open shantigilbert opened this issue 7 years ago • 2 comments

I have not tested this with other gamelists.xml but it worked with all of mine so maybe it can be of use.

I ran into another problem so It will first convert all of the & to & and then back to & just in case the gamelist has both in them e.g

Green & the blue where partying with yellow & red will result in Green & the blue where partying with yellow & red

Then it will change &amp; from filenames in <path> so that xmlstarlet finds the node

There might be a better way to do it, but hope you find it useful

shantigilbert avatar Feb 19 '19 00:02 shantigilbert

Thanks dude, I'll test it and then merge ASAP. :+1:

meleu avatar Feb 19 '19 00:02 meleu

I just ran into another problem with single quotes so I also added &#39; to the sed command so it can also handle single quotes

we could in a way also implement this but I am not sure its needed

sed 's/&nbsp;/ /g; s/&amp;/\&/g; s/&lt;/\</g; s/&gt;/\>/g; s/&quot;/\"/g; s/#&#39;/\'"'"'/g; s/&ldquo;/\"/g; s/&rdquo;/\"/g;'

shantigilbert avatar Feb 19 '19 03:02 shantigilbert