Markdown to Plain Text - Problem
Convert basic Markdown text to plain text by removing all formatting symbols and extracting the content.
The input contains common Markdown elements:
- Headers:
# Header 1,## Header 2, etc. - Bold:
**bold text**or__bold text__ - Italic:
*italic text*or_italic text_ - Links:
[link text](url) - Lists:
- itemor* itemor1. item
Return the plain text content with proper spacing and line breaks preserved.
Input & Output
Example 1 — Basic Formatting
$
Input:
markdown = "# Hello **world**"
›
Output:
Hello world
💡 Note:
Header marker '#' is removed, bold markers '**' are removed, keeping the plain text content
Example 2 — Links and Lists
$
Input:
markdown = "Visit [Google](https://google.com)\n- Item 1"
›
Output:
Visit Google\nItem 1
💡 Note:
Link '[Google](https://google.com)' becomes 'Google', list marker '- ' is removed
Example 3 — Mixed Formatting
$
Input:
markdown = "## *Important* __note__"
›
Output:
Important note
💡 Note:
Header '##', italic '*', and bold '__' markers are all removed, leaving clean text
Constraints
- 1 ≤ markdown.length ≤ 104
- Input contains only valid Markdown syntax
- Formatting markers are properly paired
Visualization
Tap to expand
💡
Explanation
AI Ready
💡 Suggestion
Tab
to accept
Esc
to dismiss
// Output will appear here after running code