Code Editor Character Mismatch Flaw

Post

Posted
Rating:
#2694 (In Topic #489)
Avatar
Standard member
vynum is in the usergroup ‘Well-settled’

Charcter Mismatching while using copy/past function

Ok, I'm going to have to blame the code editor here (while editing template files) for having this flaw. Now I could be wrong, but I'm 95% certain after extensive investigation.

I have checked to make sure my text editor (UltraEdit 64bit) is set to use UTF-8 and disabled the "Allow low ASCII values to be entered (usually control codes) in my configuration.

THE PROBLEM - (The Dash Characater)

Character: "-" (Copying and pasting the dash symbol) especially two dashes "--"

Such as using the HTML comment syntax:  <-- Comment -->

If you copy and past "<--" , "-->", or "--" from your text editor and past it in the Composr editor/Search tool, the editor recognizes it as one long line two charcters in length  and not just two dashes "--".

note: However, the code editor does recognize two dashes if you type them in with your keyboard into the code editor itself.
 

Recreating The Issue

You may test this yourself if you wish. 

1.)  Place a <-- Comment --> in your favorite text editor. Or better yet, simply comment out some code.
2.)  Copy and past this into a *.tpl file of your choice inside of composr.
3.)  Save the *.tpl file
4.)  Clear ALL caches.  Your browser cach & composr cach.  "Clear Everything"!
5.)  Load the page that the template file effects. You should then see the flaw.

I was having this issue while editing the "MENU_BRANCH_dropdown_tpl" I wanted to comment out the <img> so the menu icons would not display.

I have had this same issue appear while working on 4 different websites. So I think this justifies me bringing up the issue.

If someone can not recreate this issue? Please let me know.  I will then have to lay blame either on my own text editor, bad ram, or something else?

If this could be resolved, then great!   I'm simply bringing awareness to this issue.

 

Last edit: by vynum

Online now: No Back to the top

Post

Posted
Rating:
#2695
Avatar
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
Don't have the technical reason for the continuous dash. Not an issue with the editor.

html comment syntax is actually:

<!– comment →

Last edit: by Paul Flavel

Online now: No Back to the top

Post

Posted
Rating:
#2696
Avatar
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
You can use CSS to get rid of the images as well.

Per link

Find menu__dropdown.css, then add the following down the bottom:

Code

.menu_type__dropdown img {
    max-width: 20px;
    display: none;
}
Online now: No Back to the top

Post

Posted
Rating:
#2697
Avatar
Standard member
vynum is in the usergroup ‘Well-settled’
Paul that is an invalid HTML comment syntax.

Did you copy and paste that from a text file or website and then paste it into this forum?
Look at your post very closely. If you did perform a copy/paste into this forum then
you just helped me validate the "topic" of this thread.
composr_ckedit_error.png

Please review:

https://www.w3schools.com/html/html_comments.asp
https://www.w3schools.com/tags/tag_comment.asp

You are also misunderstanding the "topic" of my post.

My post is about, and has to do with the "CKeditor" itself.  Not HTML comment syntax nor does it have to do with hiding menu icons. That has been covered already in a seperate thread.


 
Online now: No Back to the top

Post

Posted
Rating:
#2698
Avatar
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
Editing the template files is done via code editor, not ckeditor. The forums will parse this code.
Using code editor to edit the template file it will honor the html.

Forum uses ckeditor
Template editing is done via code editor if:

Home→ Admin Zone→ Setup→ Configuration→ Accessibility options
Enable code editor - enabled


code editor and ckeditor are two different things.

Anyway. All the best.
Online now: No Back to the top

Post

Posted
Rating:
#2699
Avatar
Standard member
vynum is in the usergroup ‘Well-settled’
Forum uses ckeditor
Template editing is done via code editor.

code editor and ckeditor are two different things.
You are correct.  But for the sake of newcomers to html that might see this post and since you posted incorrect syntax, perhaps by accident, I had no choice but to clarify the proper syntax.

None the less my post was intended to simply bring awareness to the "Code Editor" flaw on my side. If no one else is having this issue then they have nothing to worry about.

Again, if you posted your syntax from a "copy & paste" method into this forum, then it proves validity that even the CKeditor is having the same issue!

 Thank you for correcting me and I do appreciate your help and input :)
 
Online now: No Back to the top

Post

Posted
Rating:
#2700
Avatar
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
No worries.

Try using <!-- comment -->


Note the !

Tried it on one of my template files and it works as intended.
Online now: No Back to the top

Post

Posted
Rating:
#2701
Avatar
Standard member
vynum is in the usergroup ‘Well-settled’
Where did you learn about this syntax? 

<!– comment →

And from what source did it come from? The reason I am asking is that I have never seen an HTML comment that closed with a "→"

Also, I have never seen anyone use it, nor have I ever seen any examples of it being used as HTML code anywere on the net?

Is that a Unicode arrow? Is that an ASCII charcter? It's not on my keyboard that I can see?
Online now: No Back to the top

Post

Posted
Rating:
#2702
Avatar
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
Ignore the way ckeditor is displaying it.

Minus the extra spaces:

< ! - - comment - - >

I have added extra spaces so it shows properly in the forum. Remove the extra spaces when you use it via the code editor for your template file.

HTML Comments
Online now: No Back to the top

Post

Posted
Rating:
#2703
Avatar
Standard member
vynum is in the usergroup ‘Well-settled’
Ignore the way ckeditor is displaying it


But we shouldn't have to ignore it!

Now that brings this full circle.  That is exactly why I started this topic.  CKeditor & Code editor has a flaw no doubt.
You even had to perform a correction in the forum yourself.  I on the other hand figured it out in about 2 hours of scratching my head 00 lol, I had to perform corrections while editing *tpl files.

It is a parser issue because while using the quote tags in the forums it turns this "<–"  into the arrow thingy.

Now, with that in mind, allow me to repeat myself without placing it in quotes because the block quotes messes it up.

If you copy and past "<–" , "–>", or "-" from your text editor and past it in the Composr editor/Search tool, the editor recognizes it as one long line two charcters in length  and not just two dashes "–".

note: However, the code editor does recognize two dashes if you type them in with your keyboard into the code editor itself.

So, if anyone new to Composr runs in to this problem, be aware of this issue and undestand how to correct it.  Hopefully the parser issue will be resolved one day. Again, I'm not asking for it to be correct at this very moment.  I just want to bring awareness to the issue.

Thanks Paul for your comments and response.
Online now: No Back to the top

Post

Posted
Rating:
#2704
Avatar
Standard member
Paul Flavel is in the usergroup ‘Honoured member’
Ahhhh ding the penny drops for me.

I was reading too much into it. Yes If you copy it from say here and paste it into the code editor then it doesn't like it. But if you try and paste the same into say notepad or notepad++ it also doesn't like it. I would point my finger at ckeditor in the forum for how it parses it. Which unfortuantely is the way ckeditor is. Never been a big fan of ckeditor to be honest.
Online now: No Back to the top

Post

Posted
Rating:
#2705
Avatar
Standard member
vynum is in the usergroup ‘Well-settled’
I think am becoming a lessor fan of the Composr code editor my self.  I'm going to stick with my favorite text/code editor and ftp my goodies from now LOL.
Online now: No Back to the top

Post

Posted
Rating:
#2707
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Ok, I just read through this topic. It is a bit mixed up with misunderstandings.

CKEditor is used for content.

Editarea is used for templates.

Double dashes are parsed into long dashes. This is a part of Comcode, not directly related to CKEditor or Editarea. However it only happens for content, not templates.

Likely the difference in the editors, combined with explaining things using content, with copying and pasting, is causing the misunderstanding.

There may also be a separate misunderstanding about the syntax for HTML comments, which is making you think the issue carries over to Editarea too.

Going direct from a text editor (or typing directly) into the template editor (Editarea) should not have any issue at all.

As for there being issues typing into content, I will have a think about that.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#2710
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Ok so in the next patch release it won't parse out double dashes if there are what look like fully formed HTML opening comments being written into the text.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

ManojSree, Philip, Salman, mytracker

Forum statistics:
  • 1,298 topics, 5,830 posts, 7,064 members
  • Our newest member is flour2door
Birthdays:
Back to Top