OK, I have continued to labor my way through this, and I wanted to report 
back to anyone who might be having the same issues.

As mentioned previously, I could not get any color, for font or background, 
to stay. I found RICHTEXT_FILTER_LEVEL on line 338 of 
/home/.../mezzanine/core/defaults.py. The docs say:

http://mezzanine.jupo.org/docs/configuration.html#richtext-filter-level 

This setting allows you to change the level of filtering that occurs. 
Setting it to low will allow certain extra tags to be permitted, such as 
those required for embedding video.

However, this is *most emphatically* *NOT TRUE*. I changed this to LOW and 
then to NONE. I tried both settings with and without restarting the server.* 
IN ALL CASES*, the color is stripped out. For that matter, the embed code 
for a test YouTube video was also stripped out.

That means that this part of the docs:

http://mezzanine.jupo.org/docs/configuration.html#richtext-allowed-attributes 

List of HTML attributes that won’t be stripped from RichTextField instances.

… ‘color’, …

is also clearly wrong. And by the way, when I say 'stripped out', I mean 
from the html source code (one of the few buttons on the editor that works)

So I'm scratching my head, and wondering if maybe the strip is coming from 
somewhere else. My first suspect, the django template escape filter:

https://docs.djangoproject.com/en/1.11/ref/templates/builtins/#escape

 

This is on by default, but all it does is turn ‘>’ into the safer ‘>’ - 
meaning, the tag itself should still work. But that is not what is 
happening here. 

Using ST3's ‘find in folders’ I got *13* matches across *6* files for 
‘strip_tags’, a django.utils function for, obviously, stripping tags. These 
6 files include ones for feeds, posts, and templatetags.  It seems some are 
aimed at imports from other blog platforms. I can't see where these are 
*directly* stripping out tags from *content*, - unless *all* content, 
besides just imports, are being sent through these files - but I wouldn't 
bet against it at this point. This is *NOT* mentioned in the Mezzanine docs 
on Rich Text or TinyMCE. 

A search in the Mezzanine docs gets:

strip_tags
Search Results
Your search did not match any documents


Given that search result, it isn’t surprising that strip_tags are also not 
mentioned here: http://mezzanine.jupo.org/docs/utilities.html#
*general-template-tags* 

I don't know what else I am supposed to do or where else I am supposed to 
look.  This really shouldn't be this hard. *Things like color and embeds 
are not new, exotic technology. Both should 'just work'. If they don't, 
what is the point of a rich text ediitor in the first place?*. I would 
greatly appreciate someone knowledgeable about these things taking the time 
to explain what is going on here, and why. I'm new to Mezzanine, so I don't 
know if the docs are just out of date or have always been wrong, but 
clearly that needs to be fixed asap. 

Wait - 
Just as I was about to click 'post' and send this off, I went back for one 
more look around, and I noticed this in tinymce_setup.js:

        valid_elements: "*[*]"  // Don't strip anything since this is 
handled by bleach.

Now what, pray tell, is bleach? (as if the name and the context wasn't hint 
enough). Well, according to its github, bleach is a  'minimalistic HTML 
sanitizer for node.js', and not related the Python bleach library - which, 
of course, has its own github. Different yes, but the purpose of both is 
the same. Is any of this mentioned in the Mezzanine docs? Well, NO, of 
course not - unless you count the listing in the colophon and in the 
'Overview', where all you get is:

bleach and BeautifulSoup - for sanitizing markup in content


Nice. 7 words. And now I have to hunt down BS4 code to make color show up 
too? Where is this code? What is it set to? How do I change it? And so on. 
My friends, this is not worth the heartache. Am I really the only one 
having these issues?  

On Sunday, August 13, 2017 at 5:00:19 PM UTC-7, Malik Rumi wrote:
>
> I am not familiar with javascript and I have never used TinyMCE before. I 
> would like to change the default appearance and functionality of the editor 
> but have not been able to find a basic enough primer to understand and 
> follow along.
>
>
> *1. Why* 
>
> is a right mouse click default a bunch of table options instead of text 
> editing options like cut copy paste? *More importantly, how do I replace 
> this with those options?*
>
>
> *2. In the docs at*
>
>
>
> http://mezzanine.jupo.org/docs/packages.html?highlight=settings#mezzanine.conf.Settings
>
>
> I see a reference to *class* mezzanine.conf.*Settings**.* I have no such 
> file at that location, or any location that I have searched for. 
>
>
> *3. In the TinyMCE docs * 
>
>
> https://www.tinymce.com/docs/get-started/basic-setup/
>
>
> It talks about snippet examples. I do see these examples, but what I am 
> supposed to do with them remains a mystery. Thinking that I could just 
> copy and paste these snippets into an existing file, I've been looking all 
> over my code for a working example of 
>
>
> "tinymce.init"
>
>
> but been unable to find one.
>
>
> 4. These docs also advise: 
>
>
> "You will need to change this value according to your HTML"
>
>
> What HTML? Do they mean my templates? Which ones? All of them? Where? 
> Surely they don't mean page by page using the source code option?
>
>
> *5. Also in the TinyMCE docs*
>
>
> At https://www.tinymce.com/docs/demo/classic/
>
>
> I found a left hand column of different editor appearances. Apparently 
> what I got is something less than Basic. I'd like the Classic. How do I get 
> that installed and working as painlessly as possible? *Thank you. * 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to