Convert a markdown string to HTML and return HTML as a Unicode string. This is a shortcut function for [`Markdown`][markdown.Markdown] class to cover the most basic use case. It initializes an instance of [`Markdown`][markdown.Markdown], loads the necessary extensions and runs the
(text: str, **kwargs: Any)
| 482 | |
| 483 | |
| 484 | def markdown(text: str, **kwargs: Any) -> str: |
| 485 | """ |
| 486 | Convert a markdown string to HTML and return HTML as a Unicode string. |
| 487 | |
| 488 | This is a shortcut function for [`Markdown`][markdown.Markdown] class to cover the most |
| 489 | basic use case. It initializes an instance of [`Markdown`][markdown.Markdown], loads the |
| 490 | necessary extensions and runs the parser on the given text. |
| 491 | |
| 492 | Arguments: |
| 493 | text: Markdown formatted text as Unicode or ASCII string. |
| 494 | |
| 495 | Keyword arguments: |
| 496 | **kwargs: Any arguments accepted by the Markdown class. |
| 497 | |
| 498 | Returns: |
| 499 | A string in the specified output format. |
| 500 | |
| 501 | !!! warning |
| 502 | The Python-Markdown library does ***not*** sanitize its HTML output. |
| 503 | If you are processing Markdown input from an untrusted source, it is your |
| 504 | responsibility to ensure that it is properly sanitized. For more |
| 505 | information see [Sanitizing HTML Output](../../sanitization.md). |
| 506 | |
| 507 | """ |
| 508 | md = Markdown(**kwargs) |
| 509 | return md.convert(text) |
| 510 | |
| 511 | |
| 512 | def markdownFromFile(**kwargs: Any): |