'how do I integrate a html text editor that will allow to mark code text as a "program code" and photos and normal text with mongoDB(mongoose)

I am fairly new web developer and I would like to ask for recommendations for text editors for my website which uses pug templates(I don't think it would make a change but ill specify it anyways) which will allow user to mark some text as code for it to look nice and allow the upload of photos and different fonts.

also how do I deal with it in the backend? how do I store images in mongoDB and different fonts and some text code which has some styling? can anybody maybe write a snippet of a router working with images and texts and converting it into the database?

how do I allow the user to insert photos at the middle of the text they wrote and store it together with fonts and styles?

Thanks!



Solution 1:[1]

Okay, after a while I figured it on my own, a lot of the text editors are not free and take money, and I found a good one for free, called tinyMCE, and it takes care of the photos and all of the fonts and stuff.

The only problem is you should beware is that you cannot use escape() function in the router when receiving information since it would mess up the tags inside the tinyMCE that style the stuff.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cigien