Greasy Fork is available in English.

Discuții » Dezvoltare

Js Beautifier breaks when text.split('==/UserScript==') is matched

§
Postat în: 06-02-2021
Editat în: 06-02-2021

https://greasyfork.org/en/scripts/418889-better-greasyfork-code-reader-js-beautifier/code

You can use that page to install and also to test and see the bug happenning.

How can I fix this?

§
Postat în: 06-02-2021

I don't get it. What is the problem?

§
Postat în: 06-02-2021

The script should be able to beautify that link, but it breaks the code and doesn't shown anything after CodeBackup = CodeTextElement.split('

§
Postat în: 09-02-2021

@Konf
Did you understand the problem now?

wOxxOmMod
§
Postat în: 09-02-2021

It's displayed normally here. Add a screenshot of the problem and make sure it's not caused by some extension you're using - verify it in a new browser profile or inside an incognito window (in case you don't run extensions in incognito of course).

§
Postat în: 09-02-2021

It's displayed normally here

No, it is not. The problem is he splitting the array by array.split('==UserScript=='), but then he uses only second part of splitted array. But the code contains more than two "==UserScript==" captions, therefore some code would be lost.

I am too lasy to help here and also the code is hard to read. I would better make own version than fix this

wOxxOmMod
§
Postat în: 09-02-2021

Ah, I incorrectly thought that the problem is that the script's GreasyFork page is broken, sorry.

§
Postat în: 09-02-2021

@wOxxOm

No problem.

@Konf
lol... Is that really the problem then?
I doubt this is the problem, but I will check what you said.

§
Postat în: 09-02-2021

 

§
Postat în: 09-02-2021

 

§
Postat în: 09-02-2021

Lol, thank you so much!

I will try to fix this then...

§
Postat în: 10-02-2021
Editat în: 10-02-2021

@Konf

Yes you was right, I just erased that split code and all ==/UserScript== and that fixed the bug.

Do you think that "the code is hard to read." because it's too much commented?

If not, how do you think I could make it "look better"?

Postează un raspuns

Autentifică-te pentru a posta un răspuns.