Just thought I'd share this little tidbit

Hello, all,

I was working in DreamWeaver (don’t groan) on some .cfm files when I noticed that one of the new guys in our department was commenting out some CF code using standard HTML comments (<!-- ... -->).

This is problematic, as that code will still be processed by the CF server, even if it doesn’t show up in the browser (and it will still be visible via “View Source”.) Not to mention that if there’s an error (like a missing variable or such), it will still break the page/app!

So I tried my hand at using DWs project-wide “find” feature using RegEx to try and locate all the HTML comments in the site. It took me several tries, but I finally got it. I wanted to share this, just in case someone else needs to find every HTML comment in either a document or in an entire site/app.

Find: <!--([^-]+)(.)+([^-]+)-->

This will find every instance of HTML comment, unless there are nested comments (and just who would be crazy enough to do THAT??) :smile:

If you need to do a replace (WARNING: THIS WILL ALSO REPLACE [CDATA] AND SUCH), then I replaced with:

 <!---$1$2$3--->

LMK if you think this is useful.

V/r,

:slight_smile:

1 Like

You know SublimeText has better CF support than Dreamweaver, right?

https://packagecontrol.io/packages/ColdFusion

Yeah, I know… I’m actually in the process of switching from DW to [brackets], but I need to finish this project before I actually make the full conversion.

And, honestly, even the CF plugins for [brackets] isn’t all I was hoping for. (shrug) We’ll see. Is SublimeText a free/open-source API? If not, then I’ll be stuck with [brackets].

V/r,

:slight_smile:

SublimeText is not Open Source, but it has an open plugin API if that’s what you mean. The plugins are entirely community driven (AFAIK).

https://www.sublimetext.com/docs/3/api_reference.html

I’m surprised brackets doesn’t have good support for it. It seems like even Adobe has given up on CF… I wonder why they don’t just sell it. It’s not a bad language, but it needs to be updated and modernized quite a bit.

Actually, as much as I dislike Adobe (for a variety of reasons), I have to admit that they’ve done pretty good about keeping it going (a promise they made when they bought MacroMedia.) I’m especially impressed with what they are doing with ESAPI and security, in general.

V/r,

:slight_smile:

Dreamweaver is a pretty darned good code editor, really. It’s just that it’s a bit bloated, including all that design view stuff. Although I’ve moved on from it, I still respect it as a code editor.

Yeah, to me it just seems like they have done the bare minimum to keep selling new versions. Even their other departments don’t seem to support it that well (Brackets/Dreamweaver).

Second that.
For example, if you switch to the WYSIWYG view, select an element on the page, then switch back to code view, then the respective code (pertaining to the element you selected) is highlighted. Very nice.

BTW, I still use Sublime, though.

Me too. :slight_smile:

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.