-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Additional markdown editor options #10
Conversation
|
Well, you're right. I missed this options though, I believe some others did too. It may stay as optional fork, I don't really care about that. Jordanjay asked me to, so I did requested this pull. |
Maybe this could be an extension? I think it's possible to add buttons from a third party extension |
I think it even should be. That's kinda weird, that you can edit text using graphic menu with exception of like... three options? The other way for it is that It could be named "Markdown+" or something like that, and have just option to enable additional BBCode formatting. |
See https://github.com/flarum/core/issues/1872 @Veriael. In the future, we'll want to make the markdown bar be a normal editor toolbar that is implemented in core, so forums don't need Markdown installed to use it. You should be able to add elements to it through extensions though, it's just not obvious. You'd have to change the |
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.
Thanks for your PR!
As @matteocontrini mentioned, a couple small changes are necessary.
Also, please do not commit changes to the files in js/dist
. These will be compiled automatically once we merge to master.
<MarkdownButton title={tooltip('quote')} icon="fas fa-quote-left" style={{ prefix: '> ', multiline: true, surroundWithNewlines: true }} /> | ||
<MarkdownButton title={tooltip('code')} icon="fas fa-code" style={{ prefix: '`', suffix: '`', blockPrefix: '```', blockSuffix: '```' }} /> | ||
<MarkdownButton title={tooltip('link')} icon="fas fa-link" style={{ prefix: '[', suffix: '](url)', replaceNext: 'url', scanFor: 'https?://' }} /> | ||
<MarkdownButton title={tooltip('image')} icon="fas fa-image" style={{ prefix: '![', suffix: '](src)', replaceNext: 'src', scanFor: 'https?://' }} /> | ||
<MarkdownButton title={tooltip('center')} icon="fas fa-align-center" style={{ prefix: '[center]', suffix: '[/center]', trimFirst: true }} hotkey="c" /> |
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.
This extension only configures the Litedown bundle, which is a simple Markdown flavor.
Therefore, we should not add buttons for BBCode-specific functionality here. If anything, that would belong in our bbcode extension - however, that would first require moving the button toolbar to core, so that it can be used from other extensions as well. That is something that will take us a while to figure out, so let's focus on the Markdown part for now.
Spoilers addition with |
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.
Thank you for the PR! I agree with the requested changes from Franz and David. @Veriael, please feel free to update with those changes if you're still interested.
Closing due to inactivity |
Adds options:
Needs additional flarum-markdown.yml translations: