* Replaces tabs with spaces. * * @param {String} code Source code. * @param {Number} tabSize Size of the tab. * @return {String} Returns code with all tabs replaces by spaces.
(code, tabSize)
| 848 | * @return {String} Returns code with all tabs replaces by spaces. |
| 849 | */ |
| 850 | function processTabs(code, tabSize) |
| 851 | { |
| 852 | var tab = ''; |
| 853 | |
| 854 | for (var i = 0; i < tabSize; i++) |
| 855 | tab += ' '; |
| 856 | |
| 857 | return code.replace(/\t/g, tab); |
| 858 | }; |
| 859 | |
| 860 | /** |
| 861 | * Replaces tabs with smart spaces. |