-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add markdown toolbar #2517
Add markdown toolbar #2517
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs some design discussion (e.g. where to insert new characters, where to focus after the event occurred ...), but overall it looks nice!
I didn't any markdown editor library because of integration with GitBucket dropzone and parsing for preview by renderer.
You wrote these new functions without transpile or polyfill, which other libraries usually do, so they do not work in some browsers (e.g. IE11, Firefox for Android). However I think you don't have to care about such cases as most users uses modern browsers on their PC and you can write markdown by hand in the same manner as before.
Even Microsoft will stop supporting IE on their web services 😄
https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666
@SIkebe Thank you for your review! I fixed doc for js functions first as you suggested! |
Actually I configured how those symbols such as |
IMHO it looks very good. Another possibility is that we declare this a "feature preview": we included it in the distribution, to get more feedback from the end-users, so we might improve it later if required. |
Thank you for your feedback!
Is that mean we implement notification in html to tell users this is "feature preview" and ask feedback? |
I don't think we that that much. Just in the Announcement Text like this https://gitbucket.github.io/gitbucket-news/gitbucket/2020/07/26/gitbucket-4.34.0.html (but for the next version), we make a special Section where we say instead of "New Feature xyz" - "Feature Preview xyz", and ask the users to try it and give us feedback so that we can change it in the final form. |
@aadrian That’s sounds good to me! |
Handle branch contains / properly in branch settings
* @param {Number} posOffset | ||
* @returns {String} | ||
*/ | ||
function mdeDecWord(id, pattern, posOffset){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do Dec
stand for? Decorate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Decorate. I fixed these unclear function names 933cf5a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with Chrome on MacOS and some behaviors were weird.
- New lines are inserted after the current line when I decorate a word
- In some cases, new line is inserted even before the selected line or
-
is inserted to another line - Undo doesn't work after modifying text using toolbar
- It would be nice if it could make a list from multiple lines
At least, inserting unnecessary new lines and inserting prefixes to wrong location must be fixed.
I will revise this PR as new PR because it got messy... |
Before submitting a pull-request to GitBucket I have first:
About this PR
This PR add markdown toolbar to resolve #1793
I didn't use any markdown editor such as simpleMDE because of integration with GitBucket dropzone and parsing for preview by renderer.