crayon-syntax-highlighter icon indicating copy to clipboard operation
crayon-syntax-highlighter copied to clipboard

Bug when copy

Open mauroagr opened this issue 3 years ago • 4 comments

When i copy using button copy, some space are change to charcter unicode u00a0, and this cause bugs in arduino code; I add the replace to solve this.

mauroagr avatar Jun 30 '22 18:06 mauroagr

@mauroagr Can you give me example of arduino code, please? It would be very helpfull.

urvanov-ru avatar Jul 02 '22 19:07 urvanov-ru

hi @urvanov-ru, Here > https://www.usinainfo.com.br/blog/labirinto-com-arduino-um-jogo-de-equilibrio-com-obstaculos/ In this version the code are updated with the 'replace' code that i suggest in pull. Thanks Mauro

mauroagr avatar Jul 02 '22 21:07 mauroagr

Sorry, @mauroagr but I don't like this fix. It removes non-break space fro the code. Non-break space can be added for some reasons, for example, in string literals. Are you sure that you original code does not contain nbsp instead of normal spaces?

urvanov-ru avatar Jul 09 '22 05:07 urvanov-ru

And sorry, but I don't understand why do we need to normalize like this: var plainTextCode = plainTextCode.normalize('NFD') What this line suppose to do?

urvanov-ru avatar Jul 09 '22 06:07 urvanov-ru