<< Home

Invalid Markup Code

Use this forum for issues related to TriniTronic's Nice Watermark Plugin.

Invalid Markup Code

Postby ozneilau » Fri May 04, 2012 4:27 am

Hi Michael,

I purchased and installed Nice Watermarks and got it working with DJ Image Slider using class based watermarking and am very happy with the results. Thank-you.

Unfortunately, when Nice Watermarks is installed, the HTML code is amended so that statements are closed with
Code: Select all
>
instead of
Code: Select all
/>
making the code invalid.

I have had a look at the code but have not been able to resolve the issue. Is this something that can easily be fixed?

I am using Joomla 2.5.4 and Nice Watermarks v1.55 for Joomla 2.5.

Thanks,

Neil

P.S. I am poised to write a rave review on JED if that's any help!
ozneilau
Lithos
Lithos
 
Posts: 5
Joined: Fri May 04, 2012 3:58 am
Location: Perth, Western Australia

Re: Invalid Markup Code

Postby Michael » Mon May 07, 2012 4:18 pm

Hi Neil,

Thanks for bring this matter to my attention. The code for generating the mark up can be found in the following scripts.

Joomla 1.5
plugins/system/nicewatermark.php

Joomla 1.6
plugins/system/nicewatermark/nicewatermark.php

I did a quick survey of the code and came up with the same results as you did. All mark up in the code appear to have the proper closures, i.e. "/>"

If you are using class based image replacement, keep in mind that the script only replaces the image paths in the image tags.

Example

Before Nice Watermarks
<img class="nicewatermarks" src="PATH/TO/BE/REPLACED/BY/NICEWATERMARKS.JPG" alt="nothing else is altered by nice watermarks." >

After Nice Watermarks
<img class="nicewatermarks" src="NEW/IMAGE/PATH/NICEWATERMARKS.JPG" alt="nothing else is altered by nice watermarks." >


In the example above note that the image tag is not properly closed. With class based watermarking the image path is replaced in the image tag. All other elements/attributes are left alone. So, if the image tag is not properly closed before being processed by Nice Watermarks, it will not be closed properly afterwards.

~ Best regards
Contributed by Michael Babcock
User avatar
Michael
Cosmos
Cosmos
 
Posts: 2480
Joined: Thu Aug 14, 2008 12:30 am

Re: Invalid Markup Code

Postby ozneilau » Mon May 07, 2012 7:11 pm

Hi Michael,

Thanks for the reply.

It looks like the script is replacing more than just the image tags.

Without the watermark plugin enabled, the website I am working on has all valid code according to validator.w3.org and the beginning of the source code of looks like this:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" >
<head>
     <base href="http://new.suzygalloway.com.au/" />
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="keywords" content="suzy galloway, suzy, galloway, western australia, wa, original artwork, original art, logo, logos, art, personalised" />
  <meta name="rights" content="All rights reserved." />
  <meta name="author" content="Suzy Galloway" />
  <meta name="description" content="Suzy Galloway original artwork made in Western Australia. Commissions available." />
  <meta name="generator" content="Joomla! - Open Source Content Management" />
  <title>Original Artwork</title>
  <link rel="stylesheet" href="http://new.suzygalloway.com.au/modules/mod_djimageslider/assets/style.css" type="text/css" />
  <link rel="stylesheet" href="/plugins/system/rokbox/themes/light/rokbox-style.css" type="text/css" />
  <link rel="stylesheet" href="/libraries/gantry/css/grid-12.css" type="text/css" />
  <link rel="stylesheet" href="/libraries/gantry/css/gantry.css" type="text/css" />
  <link rel="stylesheet" href="/libraries/gantry/css/joomla.css" type="text/css" />
etc


When I enable the plugin (no other changes), validator.w3.org suddenly shows 31 errors and the above code changes to:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb"><head><base href="http://new.suzygalloway.com.au/"><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta name="keywords" content="suzy galloway, suzy, galloway, western australia, wa, original artwork, original art, logo, logos, art, personalised"><meta name="rights" content="All rights reserved."><meta name="author" content="Suzy Galloway"><meta name="description" content="Suzy Galloway original artwork made in Western Australia. Commissions available."><meta name="generator" content="Joomla! - Open Source Content Management"><title>Original Artwork</title><link rel="stylesheet" href="http://new.suzygalloway.com.au/modules/mod_djimageslider/assets/style.css" type="text/css"><link rel="stylesheet" href="/plugins/system/rokbox/themes/light/rokbox-style.css" type="text/css"><link rel="stylesheet" href="/libraries/gantry/css/grid-12.css" type="text/css"><link rel="stylesheet" href="/libraries/gantry/css/gantry.css" type="text/css"><link rel="stylesheet" href="/libraries/gantry/css/joomla.css" type="text/css">
etc


It looks like more than just the image tags are affected.

I'd really appreciate it if you could help with this.

Thanks,

Neil.
ozneilau
Lithos
Lithos
 
Posts: 5
Joined: Fri May 04, 2012 3:58 am
Location: Perth, Western Australia

Re: Invalid Markup Code

Postby Michael » Tue May 08, 2012 12:22 pm

Hi Neil,

That's interesting, and of course, it shouldn't be happening. I have some ideas why this anomaly is cropping up. I will do some digging and get back to you.

~ All the best
Contributed by Michael Babcock
User avatar
Michael
Cosmos
Cosmos
 
Posts: 2480
Joined: Thu Aug 14, 2008 12:30 am

Re: Invalid Markup Code

Postby ozneilau » Tue May 08, 2012 5:36 pm

I am looking forward to a solution!

Thanks,

Neil.
ozneilau
Lithos
Lithos
 
Posts: 5
Joined: Fri May 04, 2012 3:58 am
Location: Perth, Western Australia

Re: Invalid Markup Code

Postby Michael » Wed May 09, 2012 11:41 am

Hi Neil,

I looked into this issue a bit more. The issue is basically this, to provide the class based watermarking the extension has to take advantage of the dom document manipulation methods available in PHP. Now, one of those is saveHTML(), which does a nice job of saving any changes to the dom document. Unfortunately, it does not do a great job of saving the doc as XHTML. Instead, it saves the doc formated as HTML. Playing around with w3 validation, I discovered that the output from saveHTML() will pass HTML5, but not XHTML. I am still looking for a suitable solution. I will let you know more, when I do.

~ Best
Contributed by Michael Babcock
User avatar
Michael
Cosmos
Cosmos
 
Posts: 2480
Joined: Thu Aug 14, 2008 12:30 am

Re: Invalid Markup Code

Postby ozneilau » Wed May 09, 2012 6:04 pm

OK. Thanks for keeping me up to date and I hope there is a simple solution.

Neil
ozneilau
Lithos
Lithos
 
Posts: 5
Joined: Fri May 04, 2012 3:58 am
Location: Perth, Western Australia

Re: Invalid Markup Code

Postby Michael » Wed May 16, 2012 6:00 pm

Hey Neil,

I haven't forgotten about you. I am still working on a solution, well more appropriately a work-around. I think I have something. Although it will take me a bit more time to perfect.

~ Best
Contributed by Michael Babcock
User avatar
Michael
Cosmos
Cosmos
 
Posts: 2480
Joined: Thu Aug 14, 2008 12:30 am

Re: Invalid Markup Code

Postby ozneilau » Fri May 18, 2012 2:13 am

Hi Michael,

This is really good service! :)

Thanks,

Neil
ozneilau
Lithos
Lithos
 
Posts: 5
Joined: Fri May 04, 2012 3:58 am
Location: Perth, Western Australia


Return to Joomla: Nice Watermarks

Who is online

Users browsing this forum: No registered users and 1 guest