Whats up with the text editor?

Highlighted
Excursionist
164 0 12

Why does the the text editor change my html code.  eg if i add a line break <br /> or non-breaking space &nbsp; at the end of the text it deletes it ?.  Its screwing up basic stuff im trying to do

0 Likes
Excursionist
163 0 14

I have been dealing with problems with my code and the text editor for days now. If I make a change to any of my pages and save it it messes the formatting up and I have to go in and fix it all. I am going to have to go through all my pages and fix the code. I have been so aggravated with this. A lot of work for me.

http://www.aromatherapynaturals.com
0 Likes
Excursionist
164 0 12

In the standard page view I can understand the editor trying to 'correct you', but not in html view

0 Likes
Shopify Expert
49 0 12

Rich Text Editors ( RTE ) are text entry fields with a toolbar for text formatting ( fonts, sizes, colors, lists, etc ) at the top. They can and will jack up your code every chance they get. With every edit, with every line break, with every formatting change; they will try to update the output HTML accordingly and rarely get it perfect. And the more you edit a post, the worse it can get. Ever used a voice activated GPS or SIRI? And you talk to it and it only gets 60% of the meaning? Well thats an RTE with your formatting when you make a bunch of edits. They live by rules and you write posts on your own terms, so conflicts happen. They will add extra tags, styles and nonsense you dont want. With Shopify even in the HTML editor, several valid HTML5 tags are outright ignored and unsupported. 

Few general guidelines:

1) If you have basic HTML skills, always click the <> button in the top right and use that to format content. 

2) If you use the RTE, and know 10% HTML, click the <> icon anyway and see if anything looks strange. 

3) If you know 0% HTML, dont write your post in Word or whatever and copy and paste in. When you paste you will get more than your text, you will also get a bunch of formatting crap that you probably dont want. Type in from scratch, or copy and paste from a 'plain text' format. I cant speak for Windows users but if you put your content in TextEdit on a Mac and hit CMD+SHIFT+T you can remove all formatting bits. With plain text you can copy/paste then careuflly use the RTE tools for styles.

3) Every theme is unique. Every post is unique. Nothing is ever without issue. Don't get angry when something goes wrong, try to understand where and why it went wrong. Then once you have a workflow stick to it.

 

@radiatorstudios
0 Likes
Shopify Expert
9718 43 1377

They will also ignore things that are valid HTML5 that just get erased because the RTE doesnt understand it. 

FYI - the RTE doesn't ignore HTML5 - quite the opposite.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Shopify Expert
49 0 12

89% agree! HTML5 support is great! The Shopify team is AMAZING at improving their tools! Bugs do get fixed quickly. But, yeah, there are issues, no ones perfect and thats cool.

Main thing with the RTE is to not copy and paste from a software tool that pre-formats text for you, like Word. If you type your post in from scratch or copy and paste from plain text, then highlight and select headers and formatting and such, you will probably be fine. 

 

 

 

@radiatorstudios
1 Like
Excursionist
164 0 12

For the users here, I would say 

1) there is no good reason for a RTE text editor to override html code in the html tab.  

2) it functioned better is Shopify Classic... and didnt override html

 

 

1 Like
Shopify Expert
9718 43 1377

In theory, but if your html is a little whack to start with the RTE is going to have a bad time. And the RTE in classic also adjusted the html --  just likely not in a way that you noticed for your edits.

I get what you mean though, if you want to add invalid or wacky code you should be allowed to. Maybe suggest the addition of an extra button that will turn off some of tinymce's internal code adjustments.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Excursionist
164 0 12

I agree, your suggestion to have the ability to turn off the code checker as the ideal.  But in the mean time the RTE is frankly broken.

...because <br /> is not a bit whack.  Nor &nbsp; , nor ANY valid html

Valid html should never be deleted. 

0 Likes
Shopify Expert
9718 43 1377

...because <br /> is not a bit whack.  Nor &nbsp; , nor ANY valid html

Sadly both those items are not valid HTML5. <br> and a character reference of &#xA0;  (not sure about  &#160;) will likely be. I would have expected the RTE to do the slash removal on the break tag - but clearly it doesn't.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes