The best way to edit Markdown.Editor.js?

AI-generated summary

The discussion revolves around editing the Markdown.Editor.js file to customize the Discourse editor. Steven encountered issues while trying to edit the file directly and sought alternative solutions. Sam suggested using unique class names for the buttons and hiding spacers with CSS. Sam recommended adding a unique identifier to each spacer class, such as class='wmd-spacer wmd-spacer-1'. Steven found that using CSS to hide the wmd-spacer class worked as a temporary solution. Sam invited Steven to submit a PR to create unique classes for each button, which would provide a more permanent solution.

Hi everyone !

I made a lot of progress recently but I don’t seem to be able to do one thing : editing the Markdown.Editor file.

I tried two things :

  • launcher ssh app. I edited two plugins files (poll, lazyYT) without any problem but my modifications of the Markdown.Editor.js (I tried simple things first, like delete the lines makeSpacer(X);), are not taken into account in my forum.
  • I tried to follow these instructions : https://meta.discourse.org/t/use-custom-translation-file/13786/12
    But during the rebuild app, the bootstrap fail.

Thanks to some plugins, I have been able to add some toolbar buttons. I would like to delete the spaces after the buttons 3 and 7 for example.

I can deal without these modifications, but I’m curious. I am (more or less) able to work with the launcher ssh ou write a plugin, if you have any idea.

(Sorry for my poor english, I hope it’s clear)

A better fix is ensuring proper unique class names for the various buttons, then you can hide spacers with simple css

So class wmb-spacer, (used twice in the wmd-button-row) is not unique to only that row, or do you mean each should be unique in that row?

yes … should be class='wmd-spacer wmd-spacer-1' etc.

Thanks, I didn’t notice there was a wmd-spacer class, it helps a lot.

I tried that for now, that worked

.wmd-spacer {
    display: none;
}

I’ll try to create unique class for each button

sure, feel free to send through a pr for it.