If replace is called on a string beginning with #, a new line is added at the beginning of the result.
I tried bypassing the whole content of the function in Module:String/sandbox, the bug is still there.
I tried using it in Template:Graph:Lines/testcases#Checking_the_JSON_output (search for ff8000) using Template:Graph:Lines/sandbox.
Here's an example: test
- testtest