curriculum/challenges/english/blocks/daily-coding-challenges-python/691b559495c5cb5a37b9b489.md
Given a string that includes a blockquote in Markdown, return the equivalent HTML string.
A blockquote in Markdown is any line that:
>)Return the blockquote text surrounded by opening and closing HTML blockquote tags.
For example, given "> This is a quote", return <blockquote>This is a quote</blockquote>.
Note: The console may not display HTML tags in strings when logging messages. Check the browser console to see logs with tags included.
parse_blockquote("> This is a quote") should return "<blockquote>This is a quote</blockquote>".
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(parse_blockquote("> This is a quote"), "<blockquote>This is a quote</blockquote>")`)
}})
parse_blockquote(" > This is also a quote") should return "<blockquote>This is also a quote</blockquote>".
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(parse_blockquote(" > This is also a quote"), "<blockquote>This is also a quote</blockquote>")`)
}})
parse_blockquote(" > So Is This") should return "<blockquote>So Is This</blockquote>".
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(parse_blockquote(" > So Is This"), "<blockquote>So Is This</blockquote>")`)
}})
def parse_blockquote(markdown):
return markdown
import re
def parse_blockquote(markdown):
pattern = r"^\s*>\s+(.+)$"
match = re.match(pattern, markdown)
text = match.group(1)
return f"<blockquote>{text}</blockquote>"