fix bug: string escape
This commit is contained in:
		
							parent
							
								
									5ab8ec04a6
								
							
						
					
					
						commit
						1f3eab6593
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -57,8 +57,7 @@ export class DocParser {
 | 
			
		|||
            let [key, value] = splitTwo(line, ':');
 | 
			
		||||
            value = value.trimStart();
 | 
			
		||||
            if (value.startsWith('"') && value.endsWith('"')) {
 | 
			
		||||
                value = value.substring(1, value.length - 1);
 | 
			
		||||
                value = value.replace('\\"', '"');
 | 
			
		||||
                value = JSON.parse( value );
 | 
			
		||||
            }
 | 
			
		||||
            key = key.trimEnd();
 | 
			
		||||
            switch(key){
 | 
			
		||||
| 
						 | 
				
			
			@ -110,7 +109,7 @@ ${doc.from_url ? `from_url: ${doc.from_url}\n` : ''}name: "${doc.name}"
 | 
			
		|||
author: "${doc.author}"
 | 
			
		||||
star: ${doc.star}
 | 
			
		||||
fork: ${doc.fork}
 | 
			
		||||
desc: "${doc.desc.replaceAll("\"", "\\\"")}"
 | 
			
		||||
desc: ${JSON.stringify(doc.desc)}
 | 
			
		||||
url: ${doc.url}
 | 
			
		||||
tags: ${JSON.stringify(doc.tags)}
 | 
			
		||||
---
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue