+geo K Posted March 12, 2017 Posted March 12, 2017 I am trying to Add an HTML Comment to the Long Description. The HTML is below. When I click Submit Changes and just look at the code again [not a view listing] the last line is missing from the long description. The 1st line is present and does not display when you View the listing. Obviously, I am trying to comment out HTML code. Shouldn't that be allowed if it is a comment or have I left something out? <!-- this is a test //--> <p>Have fun and happy caching!!</p> <!-- <p>Congrats go to XYZ for ... </p> //--> Quote
+Gill & Tony Posted March 12, 2017 Posted March 12, 2017 (edited) Try removing //--> from the end of the first line and the <!-- from the start of the third. Edited March 12, 2017 by Gill & Tony Quote
+geo K Posted March 12, 2017 Author Posted March 12, 2017 When I made that change everything in The long description was removed. I am actually trying to have Line 2 display, but lines 1 and 3 be comments and not to display. Sorry, but thanks for the try. Quote
+kunarion Posted March 13, 2017 Posted March 13, 2017 (edited) When I made that change everything in The long description was removed. I am actually trying to have Line 2 display, but lines 1 and 3 be comments and not to display. Sorry, but thanks for the try. I tried that code here, and the site scrubbed the HTML (it automatically changes stuff to its own way of doing things). The <P> tags are gone, but the two comments are comments (not displayed). So the source has this: <!-- this is a test //--><br /> Have fun and happy caching!!<br /> <!-- Congrats go to XYZ for ... //--> I don't know why yours has a line missing. What if you add one additional line, and see what happens? Edited March 13, 2017 by kunarion Quote
+Viajero Perdido Posted March 13, 2017 Posted March 13, 2017 (edited) Why the double slashes? I expect it would work if you removed them. Edited March 13, 2017 by Viajero Perdido Quote
+niraD Posted March 13, 2017 Posted March 13, 2017 Historically, markup inside comments (or commented out markup) has been unreliable in browsers. Some would end the comment at the first closing tag (e.g., </p>), rather than waiting for the closing comment tag (i.e., -->). I think it makes sense for the HTML Tidy process to remove tags from the comments. Quote
+NYPaddleCacher Posted March 13, 2017 Posted March 13, 2017 Why the double slashes? I expect it would work if you removed them. I agree. The double slash can be used to comment out a single line in some languages though some recommend against it and use block comments instead. Just wrap whatever you want as a comment in <!-- and --> Quote
+geo K Posted March 14, 2017 Author Posted March 14, 2017 Why the double slashes? I used the double slashes because the panel that shows the Valid HTML Tags has double slashes. In trying this again the code is working the same way with or without double slashes. Line three has been dropped line 1 and 2 are present. Line 1 being the comment. Line 3 having the embedded HTML. I plan on trying a different browser. I am currently using Firefox. Thank you all for your time and comments. Quote
+geo K Posted March 14, 2017 Author Posted March 14, 2017 In trying this again the code is working the same way with or without double slashes. Line three has been dropped line 1 and 2 are present. Line 1 being the comment. Line 3 having the embedded HTML. I plan on trying a different browser. I am currently using Firefox. I tried Chrome, Internet Explorer, and Edge they all worked as above. Looks like embedding HTML in a comment just cannot be done! Once again thanks for all your efforts. Quote
Blue Square Thing Posted March 14, 2017 Posted March 14, 2017 Looks like embedding HTML in a comment just cannot be done! Thats because there would be no benefit, from an HTML pov, in doing so. A comment is a comment - designed for human consumption only. HTML marks up text (and so on) so that the web browser displays it in a certain way. The browser simply ignores the guts of the comment so there would never be any use for tags inside the comment. I'm sure you could place tags in a comment if you really wanted to, but they'd be displayed as standard characters. Quote
+Viajero Perdido Posted March 14, 2017 Posted March 14, 2017 Well... Comments are often used to "comment out", or temporarily deactivate sections of otherwise valid HTML. Often the intent is to reactivate it later by simply removing the comment marks. Quote
+geo K Posted March 15, 2017 Author Posted March 15, 2017 Well... Comments are often used to "comment out", or temporarily deactivate sections of otherwise valid HTML. Often the intent is to reactivate it later by simply removing the comment marks. Thank you, that is exactly the case in this situation. Quote
+NYPaddleCacher Posted March 15, 2017 Posted March 15, 2017 Well... Comments are often used to "comment out", or temporarily deactivate sections of otherwise valid HTML. Often the intent is to reactivate it later by simply removing the comment marks. Thank you, that is exactly the case in this situation. If it's some sort of HTML preprocessing (aka HTML Tidy) that is mucking with the code, the easiest solution would be to keep a local copies with and out the HTML that you want to comment out. When you want to add the code with the html back in, just edit the page and paste in the code you want. Quote
+geo K Posted March 16, 2017 Author Posted March 16, 2017 If it's some sort of HTML preprocessing (aka HTML Tidy) that is mucking with the code, the easiest solution would be to keep a local copies with and out the HTML that you want to comment out. When you want to add the code with the html back in, just edit the page and paste in the code you want. Not sure what "HTML Tidy" is, I am using vanilla GC.com with its HTML. I already store the code locally. I wanted to do this because it would be a shortcut for me: remove the comments and the code would go live! Quote
+NYPaddleCacher Posted March 16, 2017 Posted March 16, 2017 If it's some sort of HTML preprocessing (aka HTML Tidy) that is mucking with the code, the easiest solution would be to keep a local copies with and out the HTML that you want to comment out. When you want to add the code with the html back in, just edit the page and paste in the code you want. Not sure what "HTML Tidy" is, I am using vanilla GC.com with its HTML. I already store the code locally. I wanted to do this because it would be a shortcut for me: remove the comments and the code would go live! HTML TIdy is a tool web developers can use to "clean up" (i.e. tidy up) HTML entered into a form and can fix missing or malformed tags. It is highly configurable to detect tags which the site may not want users to enter (e.g. iframe tags) and is quite good at cleaning up the horrible HTML generated from Microsoft Word. Since the Long and Short Description is user entered and can contain HTML will be included in the rest of the page It's important that the HTML is valid, or it could break other parts of the page. Quote
+geo K Posted March 16, 2017 Author Posted March 16, 2017 Thanks to all who have replied to this topic. Taking you time to share your expertise, is great. I have learned a lot Quote
+Mn-treker Posted March 17, 2017 Posted March 17, 2017 Here is what I do. I upload a picture to the cache page. Then open that picture and copy the web address. Close that picture. then in note pad I paste this code. <center><img src="code goes here "></center> In the section that says code goes here. I paste that web address. Copy that whole thing then click on edit on the web page. In the box that will accept 500 characters I paste the new line of code. No worries about a web site with problems then. I have even used GIFF with this. works great. Quote
+geo K Posted March 18, 2017 Author Posted March 18, 2017 Here is what I do. I upload a picture to the cache page. Then open that picture and copy the web address. Close that picture. then in notepad I paste this code. <center><img src="code goes here "></center> In the section that says code goes here. I paste that web address. Copy that whole thing then click on edit on the web page. In the box that will accept 500 characters I paste the new line of code. No worries about a website with problems then. I have even used GIFF with this. works great. Trying to work through this. Looks like it could work. I think I am missing something in the translation though. :-) Quote
+Mn-treker Posted March 18, 2017 Posted March 18, 2017 I have sent you an e-mail with instructions. but for everybody here it is also. So here is an example from a new one that I made. GC71YRR ▼ Traditional Geocache Martin the purple Martian Step one: I find a picture from the web and copy that to the pictures folder im my computer. Or I already have one that I may have taken with my camera. That picture is also stored in my computer. Step two:I use the link on the cache page Upload Images. I upload that photo that is in my computer. A link will apear on your cache page. Step three: click that link. The picture will open. Step four: Go up to the addres bar and highlite and copy the https address. Close this page now. Step five: I have the code <center><img src="code goes here "></center> stored in my computer. I used note pad to store and save it. I find it is the best due to some word proccessors may give you goblty gok, when you copy and paste. Step six: <center><img src="code goes here "></center> hiighlite the words code goes here, leave the quotation marks. Paste the address that you copied in this spot. Step seven: Highlite and copy tha whole line of code that you just made. Step eight: click the link on your cache page under Admin tools Edit. scroll down to the box Long Description:. Paste your code here. Now click those two boxes to accept the guidelines and terms.Then submit changes. View your page, you should see your picture. As an example: <center><img src="https://s3.amazonaws.com/gs-geo-images/cd98b968-814e-4a54-9af7-e345dc75042b_l.jpg" /></center> I hope this helps. Quote
+Mn-treker Posted March 18, 2017 Posted March 18, 2017 Now this was for a picture but HTML is HTML you just have to place things in the right order. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.