S
S
Some Ipsum2020-06-15 11:09:57
Flask
Some Ipsum, 2020-06-15 11:09:57

How does it render its own markup?

Hello everyone, I am blogging. There was a problem how to display your own markup. For example:
[img] Image[/img] turns into an html tag

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2020-06-15
@Askar_Safiullin

Write your own markup transformation rules as an option:

a = '''[img] Изображение[/img]'''
re.sub(r'\[img\]\s+(.*)\[/img\]', r'<img src="\1"></img>', a)

<img src="Изображение"></img>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question