feat: support <plain> syntax for mfm
This commit is contained in:
		
							parent
							
								
									660781afd9
								
							
						
					
					
						commit
						4550a4459b
					
				
					 3 changed files with 11 additions and 0 deletions
				
			
		|  | @ -12,6 +12,7 @@ You should also include the user name that made the change. | ||||||
| ## 12.x.x (unreleased) | ## 12.x.x (unreleased) | ||||||
| 
 | 
 | ||||||
| ### Improvements | ### Improvements | ||||||
|  | - Support <plain> syntax for MFM | ||||||
| 
 | 
 | ||||||
| ### Bugfixes | ### Bugfixes | ||||||
| - Server: Fix crash at startup if TensorFlow is not supported @mei23 | - Server: Fix crash at startup if TensorFlow is not supported @mei23 | ||||||
|  |  | ||||||
|  | @ -145,6 +145,12 @@ export function toHtml(nodes: mfm.MfmNode[] | null, mentionedRemoteUsers: IMenti | ||||||
| 			a.textContent = node.props.content; | 			a.textContent = node.props.content; | ||||||
| 			return a; | 			return a; | ||||||
| 		}, | 		}, | ||||||
|  | 
 | ||||||
|  | 		plain(node) { | ||||||
|  | 			const el = doc.createElement('span'); | ||||||
|  | 			appendChildren(node.children, el); | ||||||
|  | 			return el; | ||||||
|  | 		}, | ||||||
| 	}; | 	}; | ||||||
| 
 | 
 | ||||||
| 	appendChildren(nodes, doc.body); | 	appendChildren(nodes, doc.body); | ||||||
|  |  | ||||||
|  | @ -312,6 +312,10 @@ export default defineComponent({ | ||||||
| 					})]; | 					})]; | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
|  | 				case 'plain': { | ||||||
|  | 					return [h('span', genEl(token.children))]; | ||||||
|  | 				} | ||||||
|  | 
 | ||||||
| 				default: { | 				default: { | ||||||
| 					console.error('unrecognized ast type:', token.type); | 					console.error('unrecognized ast type:', token.type); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue