Pages: [1] |
|
|
Author |
Topic: Custom html rule set doesn't work properly (Read 716 times) |
Opossumi
Posts: 13
|
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 
|
|
|
|
admin
Forum Administrator

Posts: 2446
SnippetMaster Author
|
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?
|
|
|
|
admin
Forum Administrator

Posts: 2446
SnippetMaster Author
|
When you are adding an image in the wysiwyg popup window, is there any value defined in the "border" field?
|
|
|
|
Opossumi
Posts: 13
|
Thank you for you quick aswer
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?
|
|
|
|
admin
Forum Administrator

Posts: 2446
SnippetMaster Author
|
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
|
|
|
|
Opossumi
Posts: 13
|
Just sent a mail to you.
Thanks Henri
|
|
|
|
Opossumi
Posts: 13
|
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
|
|
|
|
vibegaz
Posts: 2
|
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?
|
|
|
|
vibegaz
Posts: 2
|
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.
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?
|
|
|
|
Opossumi
Posts: 13
|
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.
Mari
|
|
|
|
Opossumi
Posts: 13
|
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
|
|
|
|
|
Pages: [1]
|
|
|
|