Markwon/assets/js/55.5b7382a9.js
Dimitry Ivanov b00d0efa9d deploy
2021-01-12 12:50:41 +03:00

1 line
28 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{224:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("ul",[a("li",[a("code",[t._v("AsyncDrawableLoader")]),t._v(" (back here since "),a("Badge",{attrs:{text:"4.0.0"}}),t._v(")")],1),t._v(" "),t._m(2),t._v(" "),a("li",[a("code",[t._v("LinkResolver")]),t._v(" (since "),a("Badge",{attrs:{text:"4.0.0"}}),t._v(", before — "),a("code",[t._v("LinkSpan.Resolver")]),t._v(")")],1),t._v(" "),a("li",[a("code",[t._v("ImageDestinationProcessor")]),t._v(" (since "),a("Badge",{attrs:{text:"4.4.0"}}),t._v(", before — "),a("code",[t._v("UrlProcessor")]),t._v(")")],1),t._v(" "),t._m(3)]),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),a("p",[t._v("Allows loading and displaying of images in markdown. Please note that if one is not specified\ndirectly (or via plugin) no images will be displayed.")]),t._v(" "),t._m(6),t._m(7),t._v(" "),a("ul",[a("li",[a("router-link",{attrs:{to:"/docs/v4/image/"}},[t._v("markwon implementation")]),t._v(" with SVG, GIF, data uri and android_assets support")],1),t._v(" "),a("li",[a("router-link",{attrs:{to:"/docs/v4/image-picasso/"}},[t._v("based on Picasso")])],1),t._v(" "),a("li",[a("router-link",{attrs:{to:"/docs/v4/image-glide/"}},[t._v("based on Glide")])],1),t._v(" "),a("li",[a("router-link",{attrs:{to:"/docs/v4/image-coil/"}},[t._v("base on Coil")])],1)]),t._v(" "),t._m(8),t._v(" "),t._m(9),a("div",{staticClass:"tip custom-block"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("Use "),a("router-link",{attrs:{to:"/docs/v4/syntax-highlight/"}},[t._v("syntax-highlight")]),t._v(" to add syntax highlighting\nto your application")],1)]),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),a("div",{staticClass:"tip custom-block"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("Please note that "),a("code",[t._v("Markwon")]),t._v(" will apply "),a("code",[t._v("LinkMovementMethod")]),t._v(" to a resulting TextView\nif there is none registered. if you wish to register own instance of a "),a("code",[t._v("MovementMethod")]),t._v("\napply it directly to a TextView or use "),a("router-link",{attrs:{to:"/docs/v4/core/movement-method-plugin.html"}},[t._v("MovementMethodPlugin")])],1)]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"configuration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" Configuration")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("MarkwonConfiguration")]),this._v(" class holds common Markwon functionality.\nThese are "),s("em",[this._v("configurable")]),this._v(" properties:")])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("code",[this._v("SyntaxHighlight")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("code",[this._v("ImageSizeResolver")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"tip custom-block"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("Additionally "),a("code",[t._v("MarkwonConfiguration")]),t._v(" holds:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("MarkwonTheme")])]),t._v(" "),a("li",[a("code",[t._v("MarkwonSpansFactory")])])]),t._v(" "),a("p",[t._v("Please note that these values can be retrieved from "),a("code",[t._v("MarkwonConfiguration")]),t._v("\ninstance, but their "),a("em",[t._v("configuration")]),t._v(" must be done by a "),a("code",[t._v("Plugin")]),t._v(" by overriding\none of the methods:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("Plugin#configureTheme")])]),t._v(" "),a("li",[a("code",[t._v("Plugin#configureSpansFactory")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"asyncdrawableloader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#asyncdrawableloader","aria-hidden":"true"}},[this._v("#")]),this._v(" AsyncDrawableLoader")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{attrs:{class:"token keyword"}},[t._v("final")]),t._v(" Markwon markwon "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" Markwon"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("builder")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("context"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("usePlugin")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("AbstractMarkwonPlugin")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("configureConfiguration")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@NonNull")]),t._v(" MarkwonConfiguration"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Builder builder"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n builder"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("asyncDrawableLoader")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),t._v("AsyncDrawableLoader"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("noOp")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("build")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("Currently "),s("code",[this._v("Markwon")]),this._v(" provides 4 implementations for loading images:")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"syntaxhighlight"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#syntaxhighlight","aria-hidden":"true"}},[this._v("#")]),this._v(" SyntaxHighlight")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{attrs:{class:"token keyword"}},[t._v("final")]),t._v(" Markwon markwon "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" Markwon"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("builder")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("this")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("usePlugin")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("AbstractMarkwonPlugin")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("configureConfiguration")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@NonNull")]),t._v(" MarkwonConfiguration"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Builder builder"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n builder"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("syntaxHighlight")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("SyntaxHighlightNoOp")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("build")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"linkresolver"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#linkresolver","aria-hidden":"true"}},[this._v("#")]),this._v(" LinkResolver")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("p",[t._v("React to a link click event. By default "),a("code",[t._v("LinkResolverDef")]),t._v(" is used,\nwhich tries to start an Activity given the "),a("code",[t._v("link")]),t._v(" argument. If no\nActivity can handle "),a("code",[t._v("link")]),t._v(" "),a("code",[t._v("LinkResolverDef")]),t._v(" silently ignores click event")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{attrs:{class:"token keyword"}},[t._v("final")]),t._v(" Markwon markwon "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" Markwon"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("builder")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("this")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("usePlugin")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("AbstractMarkwonPlugin")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("configureConfiguration")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@NonNull")]),t._v(" MarkwonConfiguration"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Builder builder"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n builder"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("linkResolver")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("LinkResolver")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("resolve")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@NonNull")]),t._v(" View view"),a("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@NonNull")]),t._v(" String link"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token comment"}},[t._v("// react to link click here")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("build")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"imagedestinationprocessor"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#imagedestinationprocessor","aria-hidden":"true"}},[this._v("#")]),this._v(" ImageDestinationProcessor")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("Process destinations (URLs) of images in your markdown. If not provided explicitly,\ndefault "),s("strong",[this._v("no-op")]),this._v(" implementation will be used, which does not modify URLs (keeping them as-is).")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("Markwon")]),this._v(" provides 2 implementations of "),s("code",[this._v("UrlProcessor")]),this._v(":")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("code",[this._v("ImageDestinationProcessorRelativeToAbsolute")])]),this._v(" "),s("li",[s("code",[this._v("ImageDestinationProcessorAssets")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"imagedestinationprocessorrelativetoabsolute"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#imagedestinationprocessorrelativetoabsolute","aria-hidden":"true"}},[this._v("#")]),this._v(" ImageDestinationProcessorRelativeToAbsolute")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("p",[a("code",[t._v("ImageDestinationProcessorRelativeToAbsolute")]),t._v(" can be used to make relative URL absolute. For example if an image is\ndefined like this: "),a("code",[t._v("![img](./art/image.JPG)")]),t._v(" and "),a("code",[t._v("ImageDestinationProcessorRelativeToAbsolute")]),t._v("\nis created with "),a("code",[t._v("https://github.com/noties/Markwon/raw/master/")]),t._v(" as the base:\n"),a("code",[t._v('new ImageDestinationProcessorRelativeToAbsolute("https://github.com/noties/Markwon/raw/master/")')]),t._v(",\nthen final image will have "),a("code",[t._v("https://github.com/noties/Markwon/raw/master/art/image.JPG")]),t._v("\nas the destination.")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"imagedestinationprocessorassets"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#imagedestinationprocessorassets","aria-hidden":"true"}},[this._v("#")]),this._v(" ImageDestinationProcessorAssets")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("ImageDestinationProcessorAssets")]),this._v(" can be used to make processed destinations to point to Android assets folder.\nSo an image: "),s("code",[this._v("![img](./art/image.JPG)")]),this._v(" will have "),s("code",[this._v("file:///android_asset/art/image.JPG")]),this._v(" as the\ndestination.")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"tip custom-block"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[t._v("Please note that "),a("code",[t._v("ImageDestinationProcessorAssets")]),t._v(" will process only URLs that have no "),a("code",[t._v("scheme")]),t._v(" information,\nso a "),a("code",[t._v("./art/image.png")]),t._v(" will become "),a("code",[t._v("file:///android_asset/art/image.JPG")]),t._v(" whilst "),a("code",[t._v("https://so.me/where.png")]),t._v("\nwill be kept as-is.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"imagesizeresolver"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#imagesizeresolver","aria-hidden":"true"}},[this._v("#")]),this._v(" ImageSizeResolver")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("ImageSizeResolver")]),this._v(" controls the size of an image to be displayed.")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{attrs:{class:"token keyword"}},[t._v("final")]),t._v(" Markwon markwon "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" Markwon"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("builder")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("this")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("usePlugin")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("AbstractMarkwonPlugin")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{attrs:{class:"token function"}},[t._v("configureConfiguration")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@NonNull")]),t._v(" MarkwonConfiguration"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Builder builder"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n builder"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("imageSizeResolver")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{attrs:{class:"token class-name"}},[t._v("ImageSizeResolver")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@NonNull")]),t._v("\n "),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Rect "),a("span",{attrs:{class:"token function"}},[t._v("resolveImageSize")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token annotation punctuation"}},[t._v("@NonNull")]),t._v(" AsyncDrawable drawable"),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("final")]),t._v(" ImageSize imageSize "),a("span",{attrs:{class:"token operator"}},[t._v("=")]),t._v(" drawable"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("getImageSize")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{attrs:{class:"token keyword"}},[t._v("return")]),t._v(" drawable"),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("getResult")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("getBounds")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{attrs:{class:"token function"}},[t._v("build")]),a("span",{attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("If not provided explicitly, default "),s("code",[this._v("ImageSizeResolverDef")]),this._v(" implementation will be used.\nIt handles 3 dimension units:")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("code",[t._v("%")]),t._v(" (percent, relative to Canvas width)")]),t._v(" "),a("li",[a("code",[t._v("em")]),t._v(" (relative to text size)")]),t._v(" "),a("li",[a("code",[t._v("px")]),t._v(" (absolute size, every dimension that is not "),a("code",[t._v("%")]),t._v(" or "),a("code",[t._v("em")]),t._v(" is considered to be "),a("em",[t._v("absolute")]),t._v(")")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-html extra-class"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{attrs:{class:"token tag"}},[a("span",{attrs:{class:"token tag"}},[a("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("img")]),t._v(" "),a("span",{attrs:{class:"token attr-name"}},[t._v("width")]),a("span",{attrs:{class:"token attr-value"}},[a("span",{attrs:{class:"token punctuation"}},[t._v("=")]),a("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("100%"),a("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{attrs:{class:"token tag"}},[a("span",{attrs:{class:"token tag"}},[a("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("img")]),t._v(" "),a("span",{attrs:{class:"token attr-name"}},[t._v("width")]),a("span",{attrs:{class:"token attr-value"}},[a("span",{attrs:{class:"token punctuation"}},[t._v("=")]),a("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("2em"),a("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{attrs:{class:"token attr-name"}},[t._v("height")]),a("span",{attrs:{class:"token attr-value"}},[a("span",{attrs:{class:"token punctuation"}},[t._v("=")]),a("span",{attrs:{class:"token punctuation"}},[t._v('"')]),t._v("10px"),a("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{attrs:{class:"token tag"}},[a("span",{attrs:{class:"token tag"}},[a("span",{attrs:{class:"token punctuation"}},[t._v("<")]),t._v("img")]),a("span",{attrs:{class:"token style-attr language-css"}},[a("span",{attrs:{class:"token attr-name"}},[t._v(" "),a("span",{attrs:{class:"token attr-name"}},[t._v("style")])]),a("span",{attrs:{class:"token punctuation"}},[t._v('="')]),a("span",{attrs:{class:"token attr-value"}},[a("span",{attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{attrs:{class:"token property"}},[t._v("width")]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 100%"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{attrs:{class:"token property"}},[t._v("height")]),a("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 8em"),a("span",{attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{attrs:{class:"token punctuation"}},[t._v("}")])]),a("span",{attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("ImageSizeResolverDef")]),this._v(" keeps the ratio of original image if one of the dimensions is missing.")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"warning custom-block"},[a("p",{staticClass:"custom-block-title"},[t._v("Height%")]),t._v(" "),a("p",[t._v("There is no support for "),a("code",[t._v("%")]),t._v(" units for "),a("code",[t._v("height")]),t._v(" dimension. This is due to the fact that\nheight of an TextView in which markdown is displayed is non-stable and changes with time\n(for example when image is loaded and applied to a TextView it will "),a("em",[t._v("increase")]),t._v(" TextView's height),\nso we will have no point-of-reference from which to "),a("em",[t._v("calculate")]),t._v(" image height.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"tip custom-block"},[a("p",{staticClass:"custom-block-title"},[t._v("TIP")]),t._v(" "),a("p",[a("code",[t._v("ImageSizeResolverDef")]),t._v(" also takes care for an image to "),a("strong",[t._v("not")]),t._v(" exceed\ncanvas width. If an image has greater width than a TextView Canvas, then\nimage will be "),a("em",[t._v("scaled-down")]),t._v(" to fit the canvas. Please note that this rule\napplies only if image has no sizes specified ("),a("code",[t._v("ImageSize == null")]),t._v(").")])])}],!1,null,null,null);e.options.__file="configuration.md";s.default=e.exports}}]);