image
-DefaultDownScalingMediaDecoder
which scales displayed images down (#329)
core
-CustomTypefaceSpan
newmergeStyles
functionality and new factory method(#298)
Thanks @c-b-himage-coil
- updateCoil
to0.13.0
(#303)
Thanks @ubuntudroid
core
-CustomTypefaceSpan(Typeface)
constructor, useCustomTypefaceSpan.create(Typeface)
orCustomTypefaceSpan.create(Typeface, boolean)
factory methods instead
ext-tables
-TableAwareMovementMethod
a special movement method to handle clicks inside tables (#289)
ext-tasklist
- changed implementation to be in line with GFM (Github flavored markdown), task list item is a regular list item (BulletList and OrderedList can contain it). Internal implementation changed from block parsing to node post processing (#291)image-glide
- update to4.11.0
versioninline-parser
- revert parsing index whenInlineProcessor
returnsnull
as resultimage-coil
- updateCoil
to0.12.0
(Coil changelog) (#284)
Thanks @magnusvs
image-coil
- usecoil-base
asapi
dependency (would require explicitcoil
dependency) (#274)
image-coil
- deliver image result if it loaded before request disposable is created (#272)ext-tables
- fix column width rounding issue
core
-MovementMethodPlugin.none()
,MovementMethodPlugin.link()
factory methodscore
-CorePlugin
hasExplicitMovementMethod
configuration method to not add implicitLinkMovementMethod
inafterSetText
core
-MarkwonTheme
isLinkedUnderlined
attribute for links(#270)
Thanks to @dallasgutauckisext-latex
-JLatexMathTheme.Padding.of(int,int,int,int)
factory methodapp-sample
- example application
html
-SimpleTagHandler
visits children tags if supplied tag is block one (#235)inline-parser
-BangInlineProcessor
properly returnsnull
if no image node is found (possible to define other inline parsers that use!
as special character)image
-AsyncDrawable
won't trigger loading if it has result (aim:RecyclerView
due to multiple attach/detach events of a View)image
-AsyncDrawable
will resume result if it isAnimatable
and was playing before detach event (aim:RecyclerView
) (#241)core
-MarkwonReducer
filter outLinkReferenceDefinition
nodes
image-glide
cacheRequestManager
inGlideImagesPlugin#create(Context)
factory method (#259)
core
-MovementMethodPlugin.create()
use explicitMovementMethodPlugin.link()
instead
image
-AsyncDrawable#hasKnownDimentions
(deprecated in4.2.1
)app
andsample
applications (merged together in aapp-sample
single app)
TextViewSpan
to obtainTextView
in which markdown is displayed (applied byCorePlugin
)TextLayoutSpan
to obtainLayout
in which markdown is displayed (applied byTablePlugin
, more specificallyTableRowSpan
to propagate layout in which cell content is displayed)HtmlEmptyTagReplacement
now is configurable byHtmlPlugin
,iframe
handling (#235)AsyncDrawable
now usesTextView
width without padding instead of width of canvas- Support for images inside table cells (
ext-tables
module) - Expose
enabledBlockTypes
inCorePlugin
- Update
jlatexmath-android
dependency (#225) - Update
image-coil
module (Coil version0.10.1
) (#244)
Thanks to @tylerbwong - Rename
UrlProcessor
toImageDestinationProcessor
(io.noties.markwon.urlprocessor
->io.noties.markwon.image.destination
) and limit its usage to process only destination URL of images (was used to also process links before) fallbackToRawInputWhenEmpty
Markwon.Builder
configuration to fallback to raw input if rendered markdown is empty (#242)
- Fix DexGuard optimization issue (#216)
Thanks @francescocervone - module
images
:GifSupport
andSvgSupport
useClass.forName
instead access to full qualified class name ext-table
: fix links in tables (#224)ext-table
: proper borders (equal for all sides)- module
core
: AddPrecomputedFutureTextSetterCompat
Thanks @KirkBushman
- add
MarkwonInlineParserPlugin
ininline-parser
module JLatexMathPlugin
now supports inline LaTeX structures viaMarkwonInlineParserPlugin
dependency (must be explicitly added toMarkwon
whilst configuring)JLatexMathPlugin
: addtheme
(to customize both inlines and blocks)- add
JLatexMathPlugin.ErrorHandler
to catch latex rendering errors and (optionally) display error drawable (#204) JLatexMathPlugin
add text color customization (#207)JLatexMathPlugin
will use text color of widget in which it is displayed if color is not set explicitly- add
SoftBreakAddsNewLinePlugin
plugin (core
module) LinkResolverDef
defaults tohttps
when a link does not have scheme information (#75)- add
option
abstraction forsample
module allowing switching of multiple cases in runtime via menu - non-empty bounds for
AsyncDrawable
when no dimensions are not yet available (#189) linkify
- option to useLinkifyCompat
inLinkifyPlugin
(#201)
Thanks to @drakeetMarkwonVisitor.BlockHandler
andBlockHandlerDef
implementation to control how blocks insert new lines after them
// default usage: new blocks parser, no inlines
final Markwon markwon = Markwon.builder(this)
.usePlugin(JLatexMathPlugin.create(textSize))
.build();
// legacy blocks (pre `4.3.0`) parsing, no inlines
final Markwon markwon = Markwon.builder(this)
.usePlugin(JLatexMathPlugin.create(textView.getTextSize(), builder -> builder.blocksLegacy(true)))
.build();
// new blocks parsing and inline parsing
final Markwon markwon = Markwon.builder(this)
.usePlugin(JLatexMathPlugin.create(textView.getTextSize(), builder -> {
// blocksEnabled and blocksLegacy can be omitted
builder
.blocksEnabled(true)
.blocksLegacy(false)
.inlinesEnabled(true);
}))
.build();
- Fixed
AsyncDrawable
display when it has placeholder with empty bounds (#189) - Fixed
syntax-highlight
where code input is empty string (#192) - Add
appendFactory
/prependFactory
inMarkwonSpansFactory.Builder
for more explicitSpanFactory
ordering (#193)
- Fix SpannableBuilder
subSequence
method - Introduce Nougat check in
BulletListItemSpan
to position bullet (for bullets to be positioned correctly when nested inside otherLeadingMarginSpan
s) - Reduced number of invalidations in AsyncDrawable when result is ready
- AsyncDrawable#hasKnownDimentions -> AsyncDrawable#hasKnownDimensions typo fix
MarkwonEditor
to highlight markdown input whilst editing (new module:markwon-editor
)CoilImagesPlugin
image loader based on Coil library (new module:markwon-image-coil
) (#166, #174)
Thanks to @tylerbwongMarkwonInlineParser
to customize inline parsing (new module:markwon-inline-parser
)- Update commonmark-java to
0.13.0
(and commonmark spec0.29
) Markwon#configuration
method to exposeMarkwonConfiguration
via public APIHeadingSpan#getLevel
getter- Add
SvgPictureMediaDecoder
inimage
module to deal with SVG without dimensions (#165) LinkSpan#getLink
methodLinkifyPlugin
applies link span that is configured byMarkwon
(obtain via span factory)LinkifyPlugin
is thread-safe
- Do not re-use RenderProps when creating a new visitor (fixes #171)
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 are not present in the classpath (#160)- Make
Markwon
instance thread-safe by using a singleMarkwonVisitor
for eachrender
call (#157) - Add
CoreProps.CODE_BLOCK_INFO
with code-block info (language)
- Add
Markwon.TextSetter
interface to be able to use PrecomputedText/PrecomputedTextCompat - Add
PrecomputedTextSetterCompat
andcompileOnly
dependency onandroidx.core:core
(clients must have this dependency in the classpath) - Add
requirePlugin(Class)
andgetPlugins
forMarkwon
instance - TablePlugin -> defer table invalidation (via
View.post
), so only one invalidation happens with each draw-call - AsyncDrawableSpan -> defer invalidation
- Fix
JLatexMathPlugin
formula placeholder (cannot have line breaks) (#149) - Fix
JLatexMathPlugin
to update resulting formula bounds whenfitCanvas=true
and formula exceed canvas width (scale down keeping formula width/height ratio)
- Fix
JLatexMathPlugin
(background-provider null) (#147)
- maven group-id change to
io.noties.markwon
(wasru.noties.markwon
) - package name change to
io.notier.markwon.*
(wasru.noties.markwon.*
) - androidx artifacts (#76)
Markwon#builder
does not require explicitCorePlugin
(added automatically), useMarkwon#builderNoCore()
to obtain a builder withoutCorePlugin
- Removed
Priority
abstraction andMarkwonPlugin#priority
(useMarkwonPlugin.Registry
) - Removed
MarkwonPlugin#configureHtmlRenderer
(for configuration useHtmlPlugin
directly) - Removed
MarkwonPlugin#configureImages
(for configuration useImagesPlugin
directly) - Added
MarkwonPlugin.Registry
andMarkwonPlugin#configure(Registry)
method CorePlugin#addOnTextAddedListener
(process raw text added)ImageSizeResolver
signature change (acceptAsyncDrawable
)LinkResolver
is now an independent entity (previously part of theLinkSpan
),LinkSpan.Resolver
->LinkResolver
AsyncDrawableScheduler
can now be called multiple times without performance penaltyAsyncDrawable
now exposes its destination, image-size, last known dimensions (canvas, text-size)AsyncDrawableLoader
signature change (acceptAsyncDrawable
)- Add
LastLineSpacingSpan
- Add
MarkwonConfiguration.Builder#asyncDrawableLoader
method ImagesPlugin
removed fromcore
artifact (also removedimages-gif
,images-okhttp
andimages-svg
artifacts and their plugins)ImagesPlugin
exposes configuration (adding scheme-handler, media-decoder, etc)ImagesPlugin
allows multiple images with the same source (URL)- Add
PlaceholderProvider
andErrorHandler
toImagesPlugin
GIF
andSVG
media-decoders are automatically added toImagesPlugin
if required libraries are found in the classpathImageItem
is now abstract, has 2 implementations:withResult
,withDecodingNeeded
- Add
images-glide
,images-picasso
,linkify
,simple-ext
modules JLatexMathPlugin
is now independent ofImagesPlugin
- Fix wrong
JLatexMathPlugin
formulas sizes (#138) JLatexMathPlugin
hasbackgroundProvider
,executorService
configurationHtmlPlugin
is self-contained (all configuration is moved in the plugin itself)
AsyncDrawable
exposesImageSize
,ImageSizeResolver
and last known dimensions (canvas width and text size)AsyncDrawableLoader
load
andcancel
signatures change - both accept anAsyncDrawable
- Fix for multiple images with the same source in
AsyncDrawableLoader
With this release Markwon
3.x.x
version goes into maintenance mode.
No new features will be added in 3.x.x
version, development is focused on 4.x.x
version.
- Fix
latex
plugin (#136) - Add
#create(Call.Factory)
factory method toOkHttpImagesPlugin
(#129)
Thanks to @ZacSweers
- Add
AsyncDrawableLoader.Builder#implementation
method (#109) - AsyncDrawable allow placeholder to have independent size (#115)
addFactory
method for MarkwonSpansFactory- Add optional spans for list blocks (bullet and ordered)
- AsyncDrawable placeholder bounds fix
- SpannableBuilder setSpans allow array of arrays
- Add
requireFactory
method to MarkwonSpansFactory - Add DrawableUtils
- Plugins, plugins, plugins
- Split basic functionality blocks into standalone modules
- Maven artifacts group changed to
ru.noties.markwon
(previously had beenru.noties
) - removed
markwon
,markwon-image-loader
,markwon-html-pareser-api
,markwon-html-parser-impl
,markwon-view
modules - new module system:
core
,ext-latex
,ext-strikethrough
,ext-tables
,ext-tasklist
,html
,image-gif
,image-okhttp
,image-svg
,recycler
,recycler-table
,syntax-highlight
- Add BufferType option for Markwon configuration
- Fix typo in AsyncDrawable waitingForDimensions
- New tests format
Markwon.render
returnsSpanned
instance of genericCharSequence
- LinkMovementMethod is applied implicitly if not set on a TextView explicitly
- Split code and codeBlock spans and factories
- Add CustomTypefaceSpan
- Add NoCopySpansFactory
- Add placeholder to image loading
Generally speaking there are a lot of changes. Most of them are not backwards-compatible.
The main point of this release is the Plugin
system that allows more fluent configuration
and opens the possibility of extending Markwon
with 3rd party functionality in a simple
and intuitive fashion. Please refer to the documentation web-site
that has information on how to start migration.
The shortest excerpt of this release can be expressed like this:
// previous v2.x.x way
Markwon.setMarkdown(textView, "**Hello there!**");
// 3.x.x
Markwon.create(context)
.setMarkdown(textView, "**Hello there!**");
But there is much more to it, please visit documentation web-site to get the full picture of latest changes.
SpannableMarkdownVisitor
Rename blockQuoteIndent to blockIndent- Fixed block new lines logic for block quote and paragraph (#82)
- AsyncDrawable fix no dimensions bug (#81)
- Update SpannableTheme to use Px instead of Dimension annotation
- Allow TaskListSpan isDone mutation
- Updated commonmark-java to 0.12.1
- Add OrderedListItemSpan measure utility method (#78)
- Add SpannableBuilder#getSpans method
- Fix DataUri scheme handler in image-loader (#74)
- Introduced a "copy" builder for SpannableThem
Thanks @c-b-h
- Add
html-parser-api
andhtml-parser-impl
modules - Add
HtmlEmptyTagReplacement
- Implement Appendable and CharSequence in SpannableBuilder
- Renamed library modules to reflect maven artifact names
- Rename
markwon-syntax
tomarkwon-syntax-highlight
- Add HtmlRenderer asbtraction
- Add CssInlineStyleParser
- Fix Theme#listItemColor and OL
- Fix task list block parser to revert parsing state when line is not matching
- Defined test format files
- image-loader add datauri parser
- image-loader add support for inline data uri image references
- Add travis configuration
- Fix image with width greater than canvas scaled
- Fix blockquote span
- Dealing with white spaces at the end of a document
- image-loader add SchemeHandler abstraction
- Add sample-latex-math module
- Fix OrderedListItemSpan text position (baseline) (#55)
- Add softBreakAddsNewLine option for SpannableConfiguration (#54)
- Paragraph text can now explicitly be spanned (#58)
Thanks to @c-b-h - Fix table border color if odd background is specified (#56)
- Add table customizations (even and header rows)
- Update commonmark to 0.11.0 and android-gif to 1.2.14
- Add syntax highlight functionality (
library-syntax
module andmarkwon-syntax
artifact) - Add headingTypeface, headingTextSizes to SpannableTheme
Thanks to @edenman - Introduce
MediaDecoder
abstraction toimage-loader
module - Introduce
SpannableFactory
Thanks for idea to @c-b-h - Update sample application to use syntax-highlight
- Update sample application to use clickable placeholder for GIF media
- Fix bullet list item size (depend on text size and not top-bottom arguments)
- Add ability to specify MovementMethod when applying markdown to a TextView
- Markdown images size is also resolved via ImageSizeResolver
- Moved
ImageSize
,ImageSizeResolver
andImageSizeResolverDef
toru.noties.markwon.renderer
package (one level up, previouslyru.noties.markwon.renderer.html
)
- Change LinkSpan to extend URLSpan. Allow default linkColor (if not set explicitly)
- Fit an image without dimensions to canvas width (and keep ratio)
- Add support for separate color for code blocks (#37)
Thanks to @Arcnor
- Fixes #28 (tables are not rendered when at the end of the markdown)
- Adds support for
indented code blocks
Thanks to @dlew
- Fixed ordered lists (when number width is greater than block margin)
- Fixed additional white spaces at the end of parsed markdown
- Fixed headings with no underline (levels 1 & 2)
- Tables can have no borders
- Support for task-lists (#2)
- Spans now are applied in reverse order (#5 #10)
- Added
SpannableBuilder
to follow the reverse order of spans - Updated
commonmark-java
to0.10.0
- Fixes #1
Initial release