SnippetMaster Support Forums
Return to main website
 
December 08, 2008, 08:27:45 PM
* Show unread posts since last visit.
* Show new replies to your posts.
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 08, 2008, 08:27:45 PM

Login with username, password and session length
Search:  
Advanced search
* Home Help Search Login Register
SnippetMaster Support Forums  |  General  |  General Discussion & Support  |  Topic: Custom html rule set doesn't work properly « previous next »
Pages: [1] Print
Author Topic: Custom html rule set doesn't work properly  (Read 716 times)
Opossumi

Posts: 13


[-] Custom html rule set doesn't work properly
« on: March 20, 2007, 12:04:52 PM »

I use Snippet Master in my client's web site, and it works mostly fine. But there's one thing that I don't understand...
There is a problem with images. I have set css to make a border in all images in the content div. (It's 1px solid black.)
But when my client adds a photo to the page, the result code Snippet Master do is: img border="0" alt="xx" width="xx" and so on....
I use custom rule set, and there is: img[class|src|alt|title|width|height], so there shouldn't be any border -attribute.
Or maybe I'm understanding something wrong. How can I disable making any html border attributes to the images?
Thank you very much  Smile
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2446

SnippetMaster Author


WWW
[-] Re: Custom html rule set doesn't work properly
« Reply #1 on: March 20, 2007, 01:52:38 PM »

I just want to confirm the problem.

You are saying that the border attribute is being added to the IMG tag, even though you have not specified it in the customer rule set?

Is this correct?

Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2446

SnippetMaster Author


WWW
[-] Re: Custom html rule set doesn't work properly
« Reply #2 on: March 20, 2007, 02:00:12 PM »

When you are adding an image in the wysiwyg popup window, is there any value defined in the "border" field?

Report to moderator   Logged
Opossumi

Posts: 13


[-] Re: Custom html rule set doesn't work properly
« Reply #3 on: March 21, 2007, 03:25:39 AM »

Thank you for you quick aswer Smile

You are saying that the border attribute is being added to the IMG tag, even though you have not specified it in the customer rule set? Is this correct?

Yes.

When you are adding an image in the wysiwyg popup window, is there any value defined in the "border" field?

I'm not sure, what there is in border field, when my client adds an image. But now there is zero in final html. In fact, I tried to remove border setting manually in wysiwyg, but nothing happened. Border attribute stays. I thought that the rule set and (x)html cleaner in wysiwyg editor would remove those unvalid markups.

Does this messy explanation help?
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2446

SnippetMaster Author


WWW
[-] Re: Custom html rule set doesn't work properly
« Reply #4 on: March 21, 2007, 03:50:41 AM »

The border attribute is valid xhtml markup.

Can you send me a link to your SnippetMaster installation URL, and a username/password?  I will try to recreate the problem and see if I can find out what is the way to stop the unwanted border attribute from being added to your code.

henri @ www.snippetmaster.com


Report to moderator   Logged
Opossumi

Posts: 13


[-] Re: Custom html rule set doesn't work properly
« Reply #5 on: March 21, 2007, 04:38:55 AM »

Just sent a mail to you.
Thanks Henri
Report to moderator   Logged
Opossumi

Posts: 13


[-] Re: Custom xhtml rule set doesn't work properly (img border="0")
« Reply #6 on: March 31, 2007, 09:25:03 AM »

This case isnt's solved yet. Border attribute is not valid xhtml strict (maybe this is not the best link, but I couldn't find any better now: http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_imagemodule) as far as I know.

So why SM add's border tag to the images? Especially when value is not applyed by user.

Here is quite same issue: http://tinymce.moxiecode.com/punbb/viewtopic.php?id=1769
but admin's solution suggestion doesn't helped me.

Regards,
Mari
Report to moderator   Logged
vibegaz

Posts: 2


[-] Re: Custom html rule set doesn't work properly
« Reply #7 on: April 03, 2007, 02:40:09 AM »

I have the same issue.

You are quite right Opossumi, the 'border' attribute is not valid XHTML, nor is 'align'.

Align should be replaced with style="float: left/right".

I cannot disable them, so everytime someone adds an image, it makes the page fail validation.

(I also get 'style="width: 140px; height: 140px"' which repeats the height and width values, but as this validates, I am not that concerned about this.)

Any updates on this?
Report to moderator   Logged
vibegaz

Posts: 2


[-] Border="0" problem worsens
« Reply #8 on: April 10, 2007, 07:42:19 AM »

I have just noticed something worse...

...when I remove border="0" in the HTML (in an <img> tag) with the 'edit HTML source' feature, it re-inserts it when I select 'Update'.

This means you cannot insert images and have valid XHTML code at all using snippet master. Shocked

I think this is a big problem - am I missing a trick here somewhere?

Anyone have any ideas apart from going in and editing each file with a standard HTML editor?
Report to moderator   Logged
Opossumi

Posts: 13


[-] Re: Custom html rule set doesn't work properly
« Reply #9 on: April 10, 2007, 09:23:07 AM »

I've been trying and trying to fix that "command" that applies the border attribute.
I've searched and removed every (img +) border -things in every file in tiny mce -folder. Nothing seems to help.
I thinks it's purely TinyMCE's problem, but I hope Henri figure out something.  Wink

Mari
Report to moderator   Logged
Opossumi

Posts: 13


[-] Re: Custom html rule set doesn't work properly
« Reply #10 on: May 02, 2007, 09:56:22 AM »

I have found temporaly solution of that problem. Sorry my English....
It's done with PHP, so your pages must be named .php
Around the area of the code you want to clean from border attribute with:
(Starting and ending points are not important)

<body>

<?php
function replace (   $t   )   {

     return preg_replace (   "/\s*border=[\"\'][^\"\'][\"\']/i", "", $t   );
}

ob_start (   "replace"   );
?>

<!-- html content -->

<?php ob_end_flush (  ); ?>

</body>

This works perfectly for me. (I don't want to take a credit of it, because it is'nt written by me.)
Of course, if you know php well, you can write more corrections. Anyway, that powerfull validator of TinyMC
should work....

Henri, have you had any time to solve this annoying problem?

Mari

Report to moderator   Logged
Pages: [1] Print 
SnippetMaster Support Forums  |  General  |  General Discussion & Support  |  Topic: Custom html rule set doesn't work properly « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!