urvanov-ru / crayon-syntax-highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
https://wordpress.org/plugins/urvanov-syntax-highlighter/
GNU General Public License v3.0
60 stars 11 forks source link

Bug when copy #41

Open mauroagr opened 2 years ago

mauroagr commented 2 years ago

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.

urvanov-ru commented 2 years ago

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

mauroagr commented 2 years ago

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

urvanov-ru commented 2 years ago

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 commented 2 years ago

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?