Closed RektPunk closed 1 week ago
I ran the code on the development version and it appears to be fixed I am running the following code
import reflex as rx
code = """
def parse_sections_regex(text):
pattern = r'<(.*?)>(.*?)</\\1>'
matches = re.findall(pattern, text, re.DOTALL)
return matches
"""
def index() -> rx.Component:
return rx.container(
rx.vstack(
rx.code_block(code, language="python", can_copy=True),
spacing="5",
justify="center",
min_height="85vh",
)
)
app = rx.App()
app.add_page(index)
That sounds great @wassafshahzad . Can you run the first example too, please?
The first one gives the following issue
TYSM, @wassafshahzad . Maybe, I can do what I want to do after version update.
@RektPunk That sounds good
Describe the bug The code block doesn't display the code as is or appears broken. I know this is due to the "\" character, but I would appreciate it if you could show me how to fix it or how to properly use it.
To Reproduce Steps to reproduce the behavior:
code = """ def parse_sections_regex(text): pattern = r'<(.?)>(.?)</\1>' matches = re.findall(pattern, text, re.DOTALL) return matches """
def index() -> rx.Component: return rx.container( rx.vstack( rx.code_block(code, language="python", can_copy=True), spacing="5", justify="center", min_height="85vh", ) ) app = rx.App() app.add_page(index)
Expected behavior Show code as is.
Screenshots
First case
Second case
Specifics (please complete the following information):