mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 15:42:59 +00:00 
			
		
		
		
	Replace tabs in JavaScript with spaces
Browsers will render tabs, but most don't let us override their default of 8 character tab stops
This commit is contained in:
		| @@ -18,8 +18,10 @@ var JavaScriptParser = function(options) { | ||||
|     this.store = options.store; | ||||
| }; | ||||
|  | ||||
| // Parse a string of JavaScript code or JSON and return the parse tree as a wikitext parse tree | ||||
| // Parse a string of JavaScript code and return the parse tree as a wikitext parse tree | ||||
| JavaScriptParser.prototype.parse = function(type,code) { | ||||
| 	// Simplisticly replace tabs with spaces. Browsers will happily render tabs but most default to 8 character tab stops | ||||
| 	code = code.replace(/\t/mg,"    "); | ||||
| 	// Try to parse the code | ||||
| 	var parseTree; | ||||
| 	try { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jeremy Ruston
					Jeremy Ruston