sphericalpm / lektor-simplemde

Plugin integrating SimpleMDE into Lektor admin
MIT License
14 stars 1 forks source link

no update of content-file using python3 3.5.3 #5

Closed j-b-grenouille closed 3 years ago

j-b-grenouille commented 4 years ago

in python virtaul env python3 3.5.3

[packages] lektor-simplemde = 0.5

show the correct Editor, but "save changes" don't change the ./content/contents.lr file (also If I delete ~/.cache/lektor/packages/dir-with-simplemde and force reinstall )

using python3 3.7.3 work as expected (tested on a different server)

Is there a Python version requirement?

mig5 commented 4 years ago

I have the same problem, but even on Python 3.7.4 it doesn't seem to work.

fab2713 commented 3 years ago

Hello,

I have the same problem for few weeks, but even on Python 3.7.3 it doesn’t seem to work.

According to this thread, the issue seems be related to React >=15.6 changes. When I replace in the TEMPLATE of lektor_simplemde.py the line:

e.value = editor.value();

by this:

Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set.call(e, editor.value());

it seems to work again!

I’m not fluent with React, so I will not send a patch witch could break previous versions. Please feel free doing it, thanks.

mig5 commented 3 years ago

@fab2713 you are a legend, thank you, I confirm that has fixed the issue for me too.

GrishaVar commented 3 years ago

Thanks the fix and pull!

FYI, the error comes from the version of Lektor, not Python. Lektor updated its React version in release 3.2.0.

fab2713 commented 3 years ago

Thanks! In order to simplify installation, is it possible to update Pypi as a 0.6 please?

apatrushev commented 3 years ago

New version released. Thank you for your help!

fab2713 commented 3 years ago

Thanks! :-)