mirror of
				https://github.com/notion-enhancer/notion-enhancer.git
				synced 2025-10-31 22:28:08 +11:00 
			
		
		
		
	use .reverse()[0] instead of .at(-1): not supported in older app env
This commit is contained in:
		
							parent
							
								
									8f8dafeb70
								
							
						
					
					
						commit
						022613d66b
					
				| @ -19,7 +19,7 @@ export default async function ({ web }, db) { | |||||||
| 
 | 
 | ||||||
|       const lines = $codeBlock.lastElementChild.innerText.split(/\r\n|\r|\n/), |       const lines = $codeBlock.lastElementChild.innerText.split(/\r\n|\r|\n/), | ||||||
|         wordWrap = $codeBlock.lastElementChild.style.wordBreak === 'break-all'; |         wordWrap = $codeBlock.lastElementChild.style.wordBreak === 'break-all'; | ||||||
|       if (lines.at(-1) === '') lines.pop(); |       if (lines.reverse()[0] === '') lines.pop(); | ||||||
| 
 | 
 | ||||||
|       let lineNumbers = ''; |       let lineNumbers = ''; | ||||||
|       for (let i = 1; i <= lines.length + 1; i++) { |       for (let i = 1; i <= lines.length + 1; i++) { | ||||||
|  | |||||||
| @ -48,7 +48,7 @@ export default async function ({ web, components }, db) { | |||||||
|     for (const $header of $headerBlocks) { |     for (const $header of $headerBlocks) { | ||||||
|       const id = $header.dataset.blockId.replace(/-/g, ''), |       const id = $header.dataset.blockId.replace(/-/g, ''), | ||||||
|         placeholder = $header.querySelector('[placeholder]').getAttribute('placeholder'), |         placeholder = $header.querySelector('[placeholder]').getAttribute('placeholder'), | ||||||
|         headerDepth = +placeholder.at(-1); |         headerDepth = +[...placeholder].reverse()[0]; | ||||||
|       if (depth && depth < headerDepth) { |       if (depth && depth < headerDepth) { | ||||||
|         indent += 18; |         indent += 18; | ||||||
|       } else if (depth > headerDepth) { |       } else if (depth > headerDepth) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user