Pages

Thursday, September 25, 2014

Wordpress replaces html comment end
"-->" with –>

While working on a "Page" in a WordPress site, I wanted to turn off some code overnight that I was going back to in the morning.

I wrapped it in "<!-- -->".

When I loaded the page, it looked okay, but I checked the source and I noticed that my syntax highlighting continued green (html comments) beyond where it should have. When I inspected the code a little closer, I realized it had converted my double dash into a hex code "–"

I found the solution in a comment here: Visual Editor now strips HTML comments where someone mentioned "Raw" I rememebered seeing a button at the top right side of the editing window.

raw button


It puts a bit of markdown code "[raw]" in your page and becomes a
"/raw" button that then puts "[/raw]" on your page.

The result was that anything inside [raw] [/raw] gets rendered to the browser exactly as it is saved in "Text" view.

Problem solved!

No comments: