Fix re-use of render-props for visitor
This commit is contained in:
parent
204b803245
commit
b22a840dbe
@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# 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
|
# 4.1.1
|
||||||
* `markwon-ext-tables`: fix padding between subsequent table blocks ([#159])
|
* `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
|
* `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(),
|
themeBuilder.build(),
|
||||||
spanFactoryBuilder.build());
|
spanFactoryBuilder.build());
|
||||||
|
|
||||||
final RenderProps renderProps = new RenderPropsImpl();
|
|
||||||
|
|
||||||
// @since 4.1.1
|
// @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(
|
final MarkwonVisitorFactory visitorFactory = MarkwonVisitorFactory.create(
|
||||||
visitorBuilder,
|
visitorBuilder,
|
||||||
configuration,
|
configuration);
|
||||||
renderProps);
|
|
||||||
|
|
||||||
return new MarkwonImpl(
|
return new MarkwonImpl(
|
||||||
bufferType,
|
bufferType,
|
||||||
|
@ -13,13 +13,12 @@ abstract class MarkwonVisitorFactory {
|
|||||||
@NonNull
|
@NonNull
|
||||||
static MarkwonVisitorFactory create(
|
static MarkwonVisitorFactory create(
|
||||||
@NonNull final MarkwonVisitorImpl.Builder builder,
|
@NonNull final MarkwonVisitorImpl.Builder builder,
|
||||||
@NonNull final MarkwonConfiguration configuration,
|
@NonNull final MarkwonConfiguration configuration) {
|
||||||
@NonNull final RenderProps renderProps) {
|
|
||||||
return new MarkwonVisitorFactory() {
|
return new MarkwonVisitorFactory() {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
MarkwonVisitor create() {
|
MarkwonVisitor create() {
|
||||||
return builder.build(configuration, renderProps);
|
return builder.build(configuration, new RenderPropsImpl());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user