Fix re-use of render-props for visitor
This commit is contained in:
		
							parent
							
								
									204b803245
								
							
						
					
					
						commit
						b22a840dbe
					
				| @ -1,5 +1,10 @@ | ||||
| # Changelog | ||||
| 
 | ||||
| # 4.1.2-SNAPSHOT | ||||
| * Do not re-use RenderProps when creating a new visitor (fixes [#171]) | ||||
| 
 | ||||
| [#171]: https://github.com/noties/Markwon/issues/171 | ||||
| 
 | ||||
| # 4.1.1 | ||||
| * `markwon-ext-tables`: fix padding between subsequent table blocks ([#159]) | ||||
| * `markwon-images`: print a single warning instead full stacktrace in case when SVG or GIF  | ||||
|  | ||||
| @ -102,13 +102,11 @@ class MarkwonBuilderImpl implements Markwon.Builder { | ||||
|                 themeBuilder.build(), | ||||
|                 spanFactoryBuilder.build()); | ||||
| 
 | ||||
|         final RenderProps renderProps = new RenderPropsImpl(); | ||||
| 
 | ||||
|         // @since 4.1.1 | ||||
|         // @since 4.1.2 - do not reuse render-props (each render call should have own render-props) | ||||
|         final MarkwonVisitorFactory visitorFactory = MarkwonVisitorFactory.create( | ||||
|                 visitorBuilder, | ||||
|                 configuration, | ||||
|                 renderProps); | ||||
|                 configuration); | ||||
| 
 | ||||
|         return new MarkwonImpl( | ||||
|                 bufferType, | ||||
|  | ||||
| @ -13,13 +13,12 @@ abstract class MarkwonVisitorFactory { | ||||
|     @NonNull | ||||
|     static MarkwonVisitorFactory create( | ||||
|             @NonNull final MarkwonVisitorImpl.Builder builder, | ||||
|             @NonNull final MarkwonConfiguration configuration, | ||||
|             @NonNull final RenderProps renderProps) { | ||||
|             @NonNull final MarkwonConfiguration configuration) { | ||||
|         return new MarkwonVisitorFactory() { | ||||
|             @NonNull | ||||
|             @Override | ||||
|             MarkwonVisitor create() { | ||||
|                 return builder.build(configuration, renderProps); | ||||
|                 return builder.build(configuration, new RenderPropsImpl()); | ||||
|             } | ||||
|         }; | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Dimitry Ivanov
						Dimitry Ivanov