Markdown button classnames can overlap with user-based classnames
See original GitHub issueWe got a report from one of our users that Markdown buttons are broken.
The original issue https://github.com/Megabit/Blazorise/issues/4060
Basically, it seems that the class names that are used by this library can overlap with Bootstrap or with any other user classes. They are too generic with names table
, bold
, italic
, etc.
I have tried to change them dynamically after the MDE instance is created with the following code:
const easyMDE = new EasyMDE(mdeOptions);
if (easyMDE.options.toolbar) {
for (let index = 0; index < easyMDE.options.toolbar.length; ++index) {
const element = easyMDE.options.toolbar[index];
if (element && element.name && !element.name.startsWith("mde-")) {
element.name = "mde-" + element.name;
}
}
}
and it kinda works but not 100%. From what I can observe, the .toolbar
is a global object, and any change to it changes all of the instances. If there are 5 editors on a page, a race condition happens, and one or two editors are rendered without the previously added "mde-"
prefix.
My question is.
- How can I override MDE classnames? Is it even possible to do?
- Can MDE come with predefined classnames that include a prefix? Eg.
table
becomesmde-table
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Can I define a class name on paragraph using Markdown?
No, Markdown's syntax can't. You can set ID values with Markdown Extra through. You can use regular HTML if you like, and add...
Read more >easy-markdown-editor - Bountysource
EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving ...
Read more >Standardize classnames and layout to facilitate theming
CSS selectors should use classnames over IDs. The logic being that we build reusable classes for application in multiple contexts, with ...
Read more >Bar Charts | Google Developers
In this section, we'll see how to put labels inside (or near) the bars in a bar chart. Let's say we wanted to...
Read more >Dash User Guide and Documentation
Dash is a productive Python framework for building web applications. Written on top of Flask, Plotly.js, and React.js, Dash is ideal for building...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
2.18.0 has now been released and should be on npm in a few moments 😃
Good ideas! I think
prefixToClasses
will be easier to implement.