Error when pasting code in post editor

MillhioreBT

Member
Affected version
current version
I've had this problem with the post-thread editor for quite some time now, I don't know why no one has talked about it or have they?
What happens is the following:

Open a block of code
Copy some well-formatted code with its corresponding line breaks
Paste in the code block

Expected result:
The code copied correctly with its corresponding format.
example.lua
Code:
local x = 0

function test()
    local var = 0

    if x == 0 then
        var = 1
    end

    return var
end

Current result:
The code is copied without line breaks, so the code will be completely compacted and looks horrible
example.lua
Code:
local x = 0
function test()
    local var = 0
    if x == 0 then
        var = 1
    end
    return var
end

Important to note that the problem occurs to all existing code blocks in the publication, so if you had already manually fixed the line breaks, but you need to update the code or forgot to add another block, you will have to add all the line breaks of all the code blocks again.

Doing quick tests I realized that the action that makes this happen is the act of pasting text, for example CTRL + V or the option with the click
 
Top Bottom