HTML code editors removes code!
-
November 16, 2019 at 6:12 pm #767[anonymous]
I noticed that some code is not saved. For instance <style></style> will not ba saved.
I tried adding <p>test</p> and that was saved just fine.
November 16, 2019 at 6:27 pm #768[anonymous]Okay, <span class=”tagcolor”><</span>link<span class=”attributecolor”> rel<span class=”attributevaluecolor”>=”stylesheet”</span> type<span class=”attributevaluecolor”>=”text/css”</span> href<span class=”attributevaluecolor”>=”mystyle.css”</span></span><span class=”tagcolor”>> won’t get saved neither!</span>
November 16, 2019 at 6:30 pm #769[anonymous]Sorry, I can’t add the code that it won’t save it seems that this forum too has bugs.
November 17, 2019 at 5:38 pm #776[anonymous]Hi,
I suppose that your issue is caused by fact that TinyMCE editor removes some tags.
You can try to override editor config: https://getpublii.com/dev/how-to-add-custom-config-or-js-for-post-editor/
You should use something like this:
`{
extended_valid_elements: ‘*[*]’
}`November 20, 2019 at 7:02 pm #800[anonymous]I have a similar issue, I want to use the google model viewer.
I dont have a clue how to properly use the editor overide config.
Can you provide more examples?
This is how my tinymce.override.json looks like:
`{
extended_valid_elements : “model-viewer[class|src|ios-src|background-color|alt|camera-controls|auto-rotate]”
}`November 21, 2019 at 10:50 am #804[anonymous]@enslaved2die – I have provide you an example:
`{
extended_valid_elements: ‘*[*]’
}`It will allow any element – if you will override the extended_valid_elements as you wrote, you will broke other tags which are defined by default by Publii.
November 21, 2019 at 10:51 am #805[anonymous]Alternatively – extend this list: https://github.com/GetPublii/Publii/blob/master/app/src/components/configs/postEditor.config.js#L9
But then you will have to update it with every Publii update.
November 29, 2019 at 8:09 pm #894[anonymous]I cant get it to work. I dont know what Im doing wrong here.
My theme is actually public on github. Is there a chance that someone of the Publii team can look into it it tells me what Im doing wrong here?
September 1, 2022 at 5:12 pm #8158[anonymous]I’m still having issues with this…
I’m trying to add the following to a WYSIWYG post (source code mode), but the editor removes the tags:
<article class="kg-card kg-bookmark-card">
<p class="kg-bookmark-title">Best Themes - The Marketplace</p> <p class="kg-bookmark-description">Discover beautiful professional themes. Custom templates for magazines, blogs, news websites, content marketing & more!</p><span class="kg-bookmark-author">Best - The Professional Publishing Platform</span>I’ve already added *[*] in the Site Settings > Editors> Additional valid elements
September 7, 2022 at 9:39 pm #8306[anonymous]@candidexmedia – you can temporary solve your issue with custom TinyMCE config using:
valid_children: '+a[div|p|figure|pre|h1|h2|h3|h4|h5|h6|header|footer|article|aside|section|table|blockquote|video]',
It will be added by default in Publii v.0.41September 8, 2022 at 5:06 pm #8310[anonymous]Tomasz Dziuda wrote:@candidexmedia – you can temporary solve your issue with custom TinyMCE config using:
<span class=”enlighter-text”>valid_children: </span><span class=”enlighter-s0″>’+a[div|p|figure|pre|h1|h2|h3|h4|h5|h6|header|footer|article|aside|section|table|blockquote|video]'</span><span class=”enlighter-text”>,</span>valid_children: ‘+a[div|p|figure|pre|h1|h2|h3|h4|h5|h6|header|footer|article|aside|section|table|blockquote|video]’,valid_children: ‘+a[div|p|figure|pre|h1|h2|h3|h4|h5|h6|header|footer|article|aside|section|table|blockquote|video]’,
It will be added by default in Publii v.0.41Hi Tomasz: Where should I paste this code?
September 8, 2022 at 5:24 pm #8311[anonymous]For example in the way described here: https://getpublii.com/dev/how-to-add-custom-config-or-js-for-post-editor/
September 14, 2022 at 11:21 pm #8340[anonymous]Tomasz Dziuda wrote:For example in the way described here: https://getpublii.com/dev/how-to-add-custom-config-or-js-for-post-editor/
Is the code <span style=”color: #999999;”>(valid_children: ‘+a[div|p|figure|pre|h1|h2|h3|h4|h5|h6|header|footer|article|aside|section|table|blockquote|video]’,</span>
<span style=”color: #999999;”>It will be added by default in Publii v.0.41)</span> supposed to be pasted in tinymce.override.json or tinymce.script.js? In which folder are those two files meant to be saved in?October 6, 2022 at 4:40 pm #8488[anonymous]Hi,
As it is mentioned:
Then please add in the theme root directory the following files:
October 16, 2022 at 4:57 pm #8567[anonymous]Tomasz Dziuda wrote:Hi,
As it is mentioned:
Then please add in the theme root directory the following files:
What does “theme root directory” mean? Which folder does this refer to (see screenshot)?
Also, my first question still remains: Is the code supposed to be pasted in tinymce.override.json or tinymce.script.js?
The code in question is “valid_children: ‘+a[div|p|figure|pre|h1|h2|h3|h4|h5|h6|header|footer|ar…”
October 18, 2022 at 5:38 pm #8580[anonymous]Theme root is a main directory of your currently used theme. For configuration overrides you must use tinymce.override.json as it is dedicated to override editor settings, tinymce.script.js is used to add additional JS behaviours (not required in your case).
In your case you must create the tinymce.override.json with content like:
{
valid_children: ‘…’
}
December 5, 2022 at 9:39 pm #8876[anonymous]Tomasz Dziuda wrote:It will be added by default in Publii v.0.41
I can confirm that it works now, thanks Tomasz!
December 12, 2022 at 9:07 am #8921[anonymous]Hi sorry I’m still struggling with this – I’m running 0.41.0 on mac.
I’m building custom JS components which I want to chuck into my pages. These components can be named completely random. So for sake of arguments, I’ve developed web component called “my-custom-component” which is also it’s “html tag” name.
When I try to use <my-custom-component></my-custom-component> or <my-custom-component/> in the “html” code editor version, when I save and open the document again, the tag is gone.
I’ve tried to add custom tag name into sitesetting as my-custom-component[*] as it says here https://getpublii.com/docs/website-settings.html#editors but to no effect.
What am I doing wrong?
December 13, 2022 at 9:34 pm #8944[anonymous]@nztomas – I have added my-custom-component[*] under editor settings and it works for me perfectly
December 13, 2022 at 9:55 pm #8945[anonymous]I ended up doing the tiny_mce override json for now as the editor setting in the publi didn’t work – I’ve tried *[*] and it was still deleting tags
Even with tiny_mce override I have to enclose the tag in the divs – so I can do
<my-custom-tag></my-custom-tag>If I do just the custom tag without divs it gets deleted…
Anyway – no luck to do this with editor settings at all – it always gets deleted…