Format
EuiMarkdownFormat is a read-only way to render markdown-style content in a page. It is a peer component to EuiMarkdownEditor and has the ability to be modified by additional markdown plugins.
Built in plugins
EuiMarkdownFormat is a wrapper that will render Markdown provided. EuiMarkdownFormat uses Remark by default. The translation layer automatically substitutes raw HTML output with their EUI equivalent. This means anchor, code blocks and horizontal rules will become EuiLink, EuiCodeBlock and EuiHorizontalRule components respectively.
Text sizing and coloring
EuiMarkdownFormat uses EuiText as a wrapper to handle all the CSS styling when rendering the HTML. It also gives the ability to control the text size and color with the textSize and color props, respectively.
Link validation for security
Markdown content often comes from untrusted sources like user generated content. To help with potential security issues, EuiMarkdownRenderer by default only renders links if they begin with https:, http:, mailto:, or /.
text code block:**Links starting with http:, https:, mailto:, and / are valid:** * https://elastic.co * http://elastic.co * https link to [elastic.co](https://elastic.co) * http link to [elastic.co](http://elastic.co) * relative link to [eui doc's homepage](/) * someone@elastic.co * [email me!](mailto:someone@elastic.co) **Other link protocols are kept as their markdown source:** * ftp://elastic.co * An [ftp link](ftp://elastic.co)
By default, the link validator will not render document-relative links which do not begin with a protocol or a /, such as:
text code block:* Linking to a [page with the same current base path](editor) * Linking to a [page above this current path](../../../templates/page-template)
If you want to allow document-relative links while preserving the security benefits of restricting protocols, use the allowDocumentRelative option when
configuring the default plugins.
Kitchen sink
This example shows of all the styling and markup possibilities. It is mostly used for testing.