forked from external/vscode-xml
		
	
							parent
							
								
									b65009728c
								
							
						
					
					
						commit
						af2060dc38
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -39,6 +39,7 @@ export class V2XmlFormatter implements XmlFormatter {
 | 
			
		|||
            const nc = xml.charAt(i + 1);
 | 
			
		||||
            const nnc = xml.charAt(i + 2);
 | 
			
		||||
            const pc = xml.charAt(i - 1);
 | 
			
		||||
            const ppc = xml.charAt(i - 2);
 | 
			
		||||
 | 
			
		||||
            // entering CData
 | 
			
		||||
            if (location === Location.Text && cc === "<" && nc === "!" && nnc === "[") {
 | 
			
		||||
| 
						 | 
				
			
			@ -86,7 +87,8 @@ export class V2XmlFormatter implements XmlFormatter {
 | 
			
		|||
            // entering StartTag.StartTagName
 | 
			
		||||
            else if (location === Location.Text && cc === "<" && ["/", "!"].indexOf(nc) === -1) {
 | 
			
		||||
                // if this occurs after another tag, prepend a line break
 | 
			
		||||
                if (pc === ">") {
 | 
			
		||||
                // but do not add one if the previous tag was self-closing (it already adds its own)
 | 
			
		||||
                if (pc === ">" && ppc !== "/") {
 | 
			
		||||
                    output += `${options.newLine}${this._getIndent(options, indentLevel)}<`;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue