Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format source code #3564

Closed
labby opened this issue Mar 30, 2017 · 5 comments
Closed

format source code #3564

labby opened this issue Mar 30, 2017 · 5 comments

Comments

@labby
Copy link

labby commented Mar 30, 2017

Hi there
searched the issues and the docs but couldn't find anything about this:

After inserting my code in the source code window of tinymce and closing the window the html- code-format get lost.
(sorry, but no way tho display here with the "code" button)
Is there any way to prevent this?

@donShakespeare
Copy link

If I understand, you are trying to preserve the order of your code that you fed to TinyMCE RTE via the source code plugin.

Bear in mind that TinyMCE is first and foremost a RTE.
Even though it is highly configurable, at the end of the day its engines will dictate how things run.
TinyMCE will re-format and output HTML the way it sees fit, according to all the programming that went into its JavaScript.

Take for example a browser. No matter what broken/unbroken HTML is in your page, the browser will always provide itself with VALID HTML.
If a user made a mistake and entered <b class=example tag>Example Text<b>
The browser would mercilessly transform it to <b class="example" tag>Example Text<b>

To achieve what I think you want, I implemented a switch in my project which flips between TinyMCE and Ace/CodeMirror.
Once I switch, TinyMCE is "destroyed" on that textarea, and Ace/CodeMirror Editor takes over. Then I can continue with my code how I want it.
Of course, if I switch back to TinyMCE, the RTE would then reformat/correct everything.

@labby
Copy link
Author

labby commented Mar 31, 2017

Yes, I know that tinymce is a text editor :-) ( I think you meant RTE as rich text editor?)
But often/sometimes it is neccessary to switch to the source code for example if more than one guy is using the editor within a cms.
And often it helps to switch to source code to find out things going wrong..
Just linked an image https://doc.lepton-cms.org/media/newspics/code.jpg to make clear what I am talking about.

btw: other editors can handle this and I hoped that tinymce could do this too.

@thedrjim
Copy link

This issue has been closed due to inactivity. Tiny will soon be working with members of the community to close other old issues on our GitHub repositories.
There are some excellent discussions and reports in the main TinyMCE GitHub repository, but with so many open issues, we cannot monitor them all. Reviewing all of the issues individually would be an enormous task, requiring time that could be better spent developing new features and fixing bugs. Therefore, we are closing issues that have been inactive for over 365 days, with some exceptions.
If this issue is still relevant, please re-open this issue or create a new one.
If you have any questions or concerns, you can contact me at community-qa@tiny.cloud. You can also join the discussion on our mailing list at the following link: community-qa+subscribe@tiny.cloud.

@vmato
Copy link

vmato commented Apr 19, 2021

This issue is still actual in 2021

@alecpl
Copy link
Contributor

alecpl commented Apr 19, 2021

There's a premium plugin https://www.tiny.cloud/docs/plugins/premium/advcode/ So, a chance it will ever be implemented in a free version is really none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants