Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I stop Dreamweaver from creating self-closing tags, especially for IMG?

Explorer ,
May 29, 2023 May 29, 2023

Dreamweaver creates a self-closing tag when it inserts an image (and maybe elsewhere). How do I stop this outdated behavior? Example:

 

<img src="images/updated.gif" width="87" height="12" alt="Updated"/>

 

That closing slash causes a validation warning. Thanks.


Fred

TOPICS
Code , How to , Product issue
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 31, 2023 May 31, 2023
quote

Dreamweaver creates a self-closing tag when it inserts an image (and maybe elsewhere). How do I stop this outdated behavior? Example:

<img src="images/updated.gif" width="87" height="12" alt="Updated"/>

That closing slash causes a validation warning. Thanks.

By @Fred Brack

 

Some tasks aren't configurable from preferences, but if you want to remove the IMG ending slash luckly DW's architecture, which dates back to Macromedia, is still fairly flexible.

At least as far as dialog boxes (all in H

...
Translate
Community Expert ,
May 29, 2023 May 29, 2023

I'm not losing sleep over this.  😉  

See screenshot from W3C's Validation service.

 

image.png

 

Edit HTML.htmlhintrc from Preferences > Linting.

"tag-self-close": false,

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 29, 2023 May 29, 2023

Neither am I, Nancy, but it is an outdated practice that should be able to be suppressed. Also, you didn't comment on the rest of the Info message which says "interacts badly ..."!

 

Fred

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2023 May 29, 2023

@Fred Brack wrote:

Neither am I, Nancy, but it is an outdated practice that should be able to be suppressed. Also, you didn't comment on the rest of the Info message which says "interacts badly ..."!

 

Fred


=======

No need to.  Info only, neither a warning nor an error.  It only interacts badly with "unquoted attributes."   Do you use unquoted image attributes?  I don't.

 

Dreamweaver is not receiving updates except minimal security & compatibility updates.   No new features are being added.  It's been that way since Fall 2020.

 

 

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 30, 2023 May 30, 2023

Nancy, off-topic from the original question, but to your second paragraph ...

 

If Dreamweaver is not being enhanced in any way, are they still charging the same fee? And with Microsoft Expression Web long gone (but free now if you can find a download), is there ANY website creator software similar to those two products available today?  (I use both.) Thanks.

 

Fred

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 30, 2023 May 30, 2023

The fee is the same regardless.

 

Creative Cloud subscribers pay for the ALL apps plan to keep using discontinued apps like Muse, Fireworks, Dimension and XD.  It's the only way to get them now.  

 

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 30, 2023 May 30, 2023

CODE EDITORS:
-- Codespaces (free, browser-based) - https://github.com/features/codespaces
-- Nova (Mac only, formerly called Coda) - https://nova.app/
-- Pinegrow - https://pinegrow.com/
-- Sublime Text - http://www.sublimetext.com/
-- Visual Studio Code (free) - https://code.visualstudio.com/

+ Live Preview Extension (free)- https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server
-- Wappler ~ Visual Web App Builder - https://wappler.io/
============
ONLINE SITE BUILDERS:
-- Squarespace - https://www.squarespace.com/
-- Webflow - https://webflow.com
-- WordPress (open source) - https://wordpress.org/
 -- Wix - https://www.wix.com/

-- Framer- https://www.framer.com/

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2023 May 31, 2023
quote

Dreamweaver creates a self-closing tag when it inserts an image (and maybe elsewhere). How do I stop this outdated behavior? Example:

<img src="images/updated.gif" width="87" height="12" alt="Updated"/>

That closing slash causes a validation warning. Thanks.

By @Fred Brack

 

Some tasks aren't configurable from preferences, but if you want to remove the IMG ending slash luckly DW's architecture, which dates back to Macromedia, is still fairly flexible.

At least as far as dialog boxes (all in HTML) and commands (all in Javascript) are concerned, so the user interface remains accessible, one can still adapt and modify as one likes.

 

However, don't forget to always make a security copy, just in case...

  1. Quit DW
  2. Open the folder 
    C:\Program Files\Adobe\Adobe Dreamweaver 2021\Configuration\Objects\Common
  3. Locate the file Image.js file (that is where you have to make a backup copy)
  4. Open it with a NotePad++ editor (avoid NotePad, especially not WordPad, etc.)
  5. You should encounter a string of type 
    rtnStr = rtnStr + 'alt="' + '"/>';
  6. Just delete the ending slash
    rtnStr = rtnStr + 'alt="' + '">';
  7. Save and close the file
  8. Restart DW,
  9. Now, when you insert the image from the main menu, the slash should have disappeared in the code

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2023 May 31, 2023

Thanks, this works perfectly Lena.

Just two minor details I figured I would add...

1. In order to make changes to the Image.js file, the user will need Admin rights on their system
2. Like all of this kind of program file modification, the process needs to be repeated for every new version of DW going forward (if any).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2023 May 31, 2023

You're welcome, @Jon Fritz , I'm glad if it can help in some way.

 

Yes, you're right, you've raised two key points. Firstly, one need administrator rights to be able to modify this type of file, and secondly, when updating the program, one need to remember to carry over all these modifications.

 

Here at the studio, we generally use Ultra Compare, which is highly effective in monitoring these kinds of razor-edged adaptations.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 01, 2023 Jun 01, 2023

Thank you so much, Lena! While it is unlikely users will run validation on my pages, I would much rather have them see "No errors or warnings to show" than even an "Info" message. I've marked your answer correct!

 

Fred

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

You're welcome, thank you for your feedback!
I'm glad to see that this workaround can help you. However, you'll need to repeat the operation for each of the singlet tags (LINK, META, BR, HR,...). If you have trouble to find the files you need to modify, please let us know.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2024 Jan 18, 2024

Thanks for sharing this solution, Lena. Do you know the path to images.js on a Mac? (using Dreamweaver 21.3 on Sonoma). I tried looking in library/application support/adobe/Dreamweaver 2021/en_US but can't find it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2024 Jan 18, 2024

On Windows, the Configuration folder is hidden.  You have to check a box to show hidden files & folders from your file manager. And to save file changes, you'll need a computer user profile with administrative permissions.

 

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2024 Jan 18, 2024

Thanks for the response, Nancy. I was actually asking if anyone knew how to make the change on a Mac. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2024 Jan 18, 2024

See https://www.dmxzone.com/go/16740/clearing-dreamweaver-s-cache/

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2024 Jan 18, 2024

I'm not clear on what clearing the cache has to do with my question

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2024 Jan 18, 2024

Pardon me, I did not want to upset you, I merely wanted to answer your question on where to find the Configuration file on a Mac.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 18, 2024 Jan 18, 2024

We can lead them to water but we can't make them drink it.

 

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2024 Jan 19, 2024

To modify the program file necessary, you need to go to DW's main configuration folder, NOT the personal configuration folder that you have already found.

On a Mac, I believe all you should need to do is swap out "Library" for "Applications" in the file path you used and you should see it there.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2024 Jan 19, 2024
LATEST
quote

Thanks for sharing this solution, Lena. Do you know the path to images.js on a Mac? (using Dreamweaver 21.3 on Sonoma). I tried looking in library/application support/adobe/Dreamweaver 2021/en_US but can't find it.


By @casidoug7

 

Sorry, I didn't catch your question. In fact, I think @BenPleysier  was telling you about this URL, as many of the paths are often referenced and can provide leads.

In any case, I don't have access to a virtual machine from where I am at the moment, and it's difficult for me to check for myself, but I'd say that if it's a question of application settings, and as @Jon Fritz propose I'd look at :

 

/Applications/Adobe Dreamweaver 2021/Configuration/Objects/Common

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines