-
Notifications
You must be signed in to change notification settings - Fork 32
Conversation
This should be ready for a review, and for a possible merge. I'm not entirely satisfied with the elegance of this, but it definitely works, adding new editors should be also quite easy. |
check this please |
I am underwater right now, hope to merge it tomorrow |
I've resolved the conflict from Master. The editor is a standard textarea, so unless it has newline issues, things should work fine, at least they look all right in the live preview. The two divs, housing the stats and the live preview might be misaligned though. Images are also handled by Typegram, since the form will post Markdown, unless you wish to receive HTML as the article body, which we can do easily. We are not in a hurry, take your time, and we'll merge when you are ready. |
Code review: no test for unregistered user: don't optimized code: comments use incrybmde - not tested, not implemented preview not tested carefully - not mutch with the result (see #76 (comment)) so i think - I want to think just add this option... Give me some time |
no test for unregistered user
You are right. I could check for the path here. The problem is that the Editor field is in a global hook, as you said, and I would rather not get the user struct for every request. Typegram, however, includes the editor everywhere, even if you do not use it, which is also not great. The only places where we should include code related to the editor are the settings, article and articleEdit pages.
comments use incrybmde - not tested, not implemented
Oops, I think I forgot to commit article.html. It is definitely using the minimalistic editor here.
looks ugly
I think we can fix this via CSS.
add disable javascript - it will be the global option.
Disabling javascript is a nice option, but I think Markdown definitely needs a preview, especially for the average user, who will probably have javascript enabled.
It could be frustrating that you only catch a mistake when you click submit, view your article and then you have to edit again to fix it.
I am not against disabling javascript, but I don’t think that it would replace this in features.
As I have mentioned earlier, I am not happy with the state of this patch, it definitely needs optimisation, but I think we can do it. Visually impaired users will be able to use an accessible editor with most of the features in tact, while other editors can be implemented easier, if someone chooses to. For example CK Editor, etc.
|
i created branch https://github.com/recoilme/tgram/tree/editor And i added nojavascript option in the main branch, as some solution for visually impaired users and users who dont like javascript They may use classic textarea now I do not think that the possibility of previewing is so important but if you want to make it it should look beautiful and work correctly. For me, it's better not to do anything than do it badly. I'm sorry that I did not include your code, Robert in the release (It's too bad, but I do not have time right now and I'm not so good at the front end to try to bring this feature to the release. Maybe return to it later |
Thank you. I absolutely understand your reasoning, and I agree, you should not release something which does not meet Typegram standards. The problem is that my JS and CSS knowledge is nonexistent, apart from the basics. I personally do not need markdown preview, since I'm writing markdown for quite a long time now, but it is incredibly useful, along with the statistics, if you are a writer, because you can immediately see if you did something wrong, and keep track of your progress that way. Thank you so much for adding the noJS option, it is very much appreciated. Hopefully, we can return to this later. |
This is just an initial commit, not ready to merge yet.
This implementation uses Showdown and Countable, both under MIT.
The templates will probably need some visual adjustment.
I am currently investigating why an oninput event will not fire on the MDE textarea.