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