mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 13:20:59 +00:00 
			
		
		
		
	LibMarkdown: Change MD Document parse API to return a RefPtr
Markdown documents are now obtained via the static Document::parse method, which returns a RefPtr<Document>, or nullptr on failure.
This commit is contained in:
		
							parent
							
								
									9a2177437b
								
							
						
					
					
						commit
						7ca562b200
					
				
				
				Notes:
				
					sideshowbarker
				
				2024-07-19 05:59:02 +09:00 
				
			
			Author: https://github.com/FalseHonesty
Commit: 7ca562b200
Pull-request: https://github.com/SerenityOS/serenity/pull/2195
Reviewed-by: https://github.com/bugaevc
			
					 8 changed files with 28 additions and 28 deletions
				
			
		|  | @ -332,11 +332,11 @@ void PageView::reload() | |||
| 
 | ||||
| static RefPtr<Document> create_markdown_document(const ByteBuffer& data, const URL& url) | ||||
| { | ||||
|     Markdown::Document markdown_document; | ||||
|     if (!markdown_document.parse(data)) | ||||
|     auto markdown_document = Markdown::Document::parse(data); | ||||
|     if (!markdown_document) | ||||
|         return nullptr; | ||||
| 
 | ||||
|     return parse_html_document(markdown_document.render_to_html(), url); | ||||
|     return parse_html_document(markdown_document->render_to_html(), url); | ||||
| } | ||||
| 
 | ||||
| static RefPtr<Document> create_text_document(const ByteBuffer& data, const URL& url) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 FalseHonesty
						FalseHonesty