-
Notifications
You must be signed in to change notification settings - Fork 843
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
Checkbox support on Markdown preview #6401
Conversation
What label would you like to add? |
I believe Editor and dependencies would be good. |
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.
Looks great! Thank you!
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.
haven't tested it but code looks good to me.
please squash everything to one commit and force push since this PR looks ready to merge.
ide/markdown/src/org/netbeans/modules/markdown/ui/preview/views/ViewUtils.java
Outdated
Show resolved
Hide resolved
Markdown Preview * Support checkbox on preview * A utils class to handle some Html Elements * A custom MarkdownEditorKit * A MarkdownViewFactory to create custom views for preview. * Update dependecy FlexMark library from 1.14 to 1.15. Fix public-packages declaration to just use subpackages. Included flexmark-ext-gfm-tasklist-0.62.2.jar to license file. Removed non necessary utility class.
081e917
to
5d92f5d
Compare
Done! |
@moacirrf congrats to your first contribution! |
Added support for Checkbox on Markdown Preview and some other changes that i will explain.
Project: Markdown Support
Added a package ui.preview and and ui.preview.views
MarkdownEditorKit.java : Is reponsible to supply a custom ViewFactory and this class has a very interesting method called getStyleSheet that is important to deal with themes on JEditorPane, so i believe that was better extract to a new class to avoid use of Anonymous class.
MarkdownViewFactory : Is responsible to create custom views to JEditorPane, it will receive a Html element and convert to the most similar swing component.
ViewUtils.java: Just a utility class to deal with HTML elements.
CheckboxView.java: A view of a Checkbox in this example was necessary create a custom just to preserve state checked and fix some border
Project: Markdown Library
Added flexmark-ext-gfm-tasklist to support of checkboxes.
Ps.: I do not have option to add a Label...