zhenyong97 / flask-mdeditor

A Markdown Editor as Flask extention
MIT License
17 stars 6 forks source link

Markup cannot be imported from Flask since Flask 3.0.0 #4

Closed fantomH closed 8 months ago

fantomH commented 10 months ago

There is a problem with importing Markup from Flask 3.0.0, thus flask-mdeditor no longer works.

from init.py

from flask import current_app, Markup, request, Blueprint, url_for, render_template_string, render_template, request

Markup has been removed from Flask.

The workaround, for now seems to downgrade Flask to its 2.3.3 version.

redredkrovy commented 8 months ago

I noticed that too. I was looking for a CKEditor alternative.

redredkrovy commented 8 months ago

Looking at the init file you just need to remove Markup from the flask import line, then "pip install MarkupSafe" in your virtual environment, and add "from markupsafe import Markup" to the init file. Works fine after that.

zhenyong97 commented 8 months ago

@redredkrovy, thank you for your interest! Currently, it seems that the package is not compatible with Flask 3.0. I greatly welcome you to submit a PR to implement this functionality. In the meantime, I will also try to work on implementing this feature in the coming days.