codePreviews: fix line number regex
This commit is contained in:
		
							parent
							
								
									4c681a137e
								
							
						
					
					
						commit
						fa91219714
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -44,12 +44,12 @@ events.add("messageCreate", "codePreviews", async function (msg) {
 | 
				
			||||||
          ? ""
 | 
					          ? ""
 | 
				
			||||||
          : fileName.substring(fileName.indexOf(".") + 1);
 | 
					          : fileName.substring(fileName.indexOf(".") + 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const lineStr = link.match(/#L\d+?(-L\d+?)?/)?.[0];
 | 
					      const lineStr = link.match(/#L\d+(-L\d+)?/)?.[0];
 | 
				
			||||||
      let startLine, endLine;
 | 
					      let startLine, endLine;
 | 
				
			||||||
      let entireFile = false;
 | 
					      let entireFile = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (lineStr) {
 | 
					      if (lineStr) {
 | 
				
			||||||
        let [start, end] = link.match(/L\d+?/g);
 | 
					        let [start, end] = link.match(/L\d+/g);
 | 
				
			||||||
        start = parseInt(start.replace("L", ""));
 | 
					        start = parseInt(start.replace("L", ""));
 | 
				
			||||||
        if (!end) {
 | 
					        if (!end) {
 | 
				
			||||||
          startLine = endLine = start;
 | 
					          startLine = endLine = start;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue