Add multiline math syntax
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
This commit is contained in:
		
							parent
							
								
									4398651841
								
							
						
					
					
						commit
						79d2374d8e
					
				
					 6 changed files with 62 additions and 17 deletions
				
			
		
							
								
								
									
										19
									
								
								test/mfm.ts
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								test/mfm.ts
									
										
									
									
									
								
							|  | @ -836,15 +836,26 @@ describe('MFM', () => { | |||
| 			}); | ||||
| 		}); | ||||
| 
 | ||||
| 		it('math', () => { | ||||
| 		it('mathInline', () => { | ||||
| 			const fomula = 'x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}'; | ||||
| 			const text = `\\(${fomula}\\)`; | ||||
| 			const tokens = analyze(text); | ||||
| 			const content = `\\(${fomula}\\)`; | ||||
| 			const tokens = analyze(content); | ||||
| 			assert.deepStrictEqual(tokens, [ | ||||
| 				leaf('math', { formula: fomula }) | ||||
| 				leaf('mathInline', { formula: fomula }) | ||||
| 			]); | ||||
| 		}); | ||||
| 
 | ||||
| 		describe('mathBlock', () => { | ||||
| 			it('simple', () => { | ||||
| 				const fomula = 'x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}'; | ||||
| 				const content = `\\[\n${fomula}\n\\]`; | ||||
| 				const tokens = analyze(content); | ||||
| 				assert.deepStrictEqual(tokens, [ | ||||
| 					leaf('mathBlock', { formula: fomula }) | ||||
| 				]); | ||||
| 			}); | ||||
| 		}); | ||||
| 
 | ||||
| 		it('search', () => { | ||||
| 			const tokens1 = analyze('a b c 検索'); | ||||
| 			assert.deepStrictEqual(tokens1, [ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue