karthick2014 / jwysiwyg

Automatically exported from code.google.com/p/jwysiwyg
0 stars 0 forks source link

strong and em tags in firefox #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Select the text
2. click in the bold or italic button

What is the expected output? What do you see instead?
The expected output is the <strong> or <em> tags.
I see that apply the tag <span style="font-weight: bold;"> or <span
style="font-style: italic;"> When I have the strong or em tags, the editor
does this:
<strong style="font-weight: bold;">

What version of the product are you using? On what operating system?
jquery.jwyiwyg.js => 0.3
jquery.js => 1.2.2
S.O. Windows XP with Mozilla Firefox 2.0.0.14

Please provide any additional information below.

Original issue reported on code.google.com by oscarot...@gmail.com on 30 Apr 2008 at 11:23

GoogleCodeExporter commented 8 years ago
How do you get FF to use strong or em tags? I'm fine with it ending up with a
redundant style tag, since I'm using HTML Purifier to clean up the HTML before
publishing it anyway (highly recommended to avoid XSS flaws).

Original comment by mattcoo...@gmail.com on 25 Jun 2008 at 4:49

GoogleCodeExporter commented 8 years ago
Ive got the same problem:

FF 3.04, UBUNTU 8.10, JQUERY 1.2.6

Original comment by timvanoo...@gmail.com on 8 Dec 2008 at 3:29

GoogleCodeExporter commented 8 years ago
Set parameter

brIE : false

Original comment by jure...@gmail.com on 23 Dec 2008 at 3:02

GoogleCodeExporter commented 8 years ago
I tried set brIE as false, but doesn't work. Any reasons ?
Thanks.

Original comment by vver...@gmail.com on 23 Mar 2009 at 4:08

GoogleCodeExporter commented 8 years ago
Doc: http://www.mozilla.org/editor/midas-spec.html
'styleWithCSS' must be false.

Something like this:
.editorDoc.execCommand('styleWithCSS', false, false);

Then you'v got 'b'|'i'|'u' tags =)

Original comment by Svel.So...@gmail.com on 28 Mar 2009 at 5:42

GoogleCodeExporter commented 8 years ago
OK, so we need to use

            this.editorDoc.execCommand('styleWithCSS', false, false);

Where do we put this line in the code?  I've put it under

            this.editorDoc.contentEditable = 'true';

But it doesn't make any difference.

Original comment by gpear...@gmail.com on 14 Apr 2009 at 8:52

GoogleCodeExporter commented 8 years ago
This is the same issue that 21. And you can find the solution there. If you 
want I can help you make it! And 
ofcourse test it... 

Original comment by jor...@gmail.com on 28 Apr 2009 at 12:23

GoogleCodeExporter commented 8 years ago

According to Matt Cutts’s SEO video on qualities of a good site video, he 
said that
Google treats the bold and strong tag with the same weight-age. Well, if you 
are into
the finer details of the semantics of markup then it is prefer to use 
<"strong"> tag.
On other hand, if you are into minimizing typing time then it is prefer to use 
<"b"> tag.

Original comment by waliaro...@gmail.com on 15 May 2009 at 1:39

GoogleCodeExporter commented 8 years ago
Any progress in this? I can't imagine it would be hard to get it to use 
<strong> tags
instead of <span...>.

Original comment by TikiSt...@gmail.com on 18 May 2009 at 8:37

GoogleCodeExporter commented 8 years ago
I've got a quick work-around for those looking to get the tags instead of the 
css in
FF. Here is a look at the bold syntax. I basically, just added in the comments 
from
above and its working fine in FF 3.0.15. Love to see it addressed globally.

bold          : { visible : true, tags : ['b'], exec: function(){
        var selection = $(this.editor).documentSelection();
        this.editorDoc.execCommand('styleWithCSS', false, false);
        this.editorDoc.execCommand('bold', false, selection)    
        }

Original comment by tob...@gmail.com on 4 Aug 2009 at 3:35

GoogleCodeExporter commented 8 years ago
You can add "self.editorDoc.execCommand('styleWithCSS', false, false);" to  
"appendMenu : function( cmd, args, className, fn ){.....}"

        appendMenu : function( cmd, args, className, fn )
        {
            var self = this;
            var args = args || [];

            $('<li></li>').append(
                $('<a><!-- --></a>').addClass(className || cmd)
            ).mousedown(function() {
                if ( fn ) fn.apply(self); 
                else {
                    self.editorDoc.execCommand('styleWithCSS', 
false, false); // ! Execute before all commands
                    self.editorDoc.execCommand(cmd, false, args);
                }
                if ( self.options.autoSave ) self.saveContent();
            }).appendTo( this.panel );
        },

Original comment by AndreyKo...@gmail.com on 7 Aug 2009 at 8:55

GoogleCodeExporter commented 8 years ago
Issue 21 has been merged into this issue.

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 12:21

GoogleCodeExporter commented 8 years ago

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 12:22

GoogleCodeExporter commented 8 years ago

Original comment by akzhan.a...@gmail.com on 8 Dec 2009 at 12:52

GoogleCodeExporter commented 8 years ago
/* make iframe editable */
    if ($.browser.msie) {
        this.doc.body.contentEditable = true;
// * temporany fix for elrte bug on firefox */
    } else if ($.browser.mozilla) { 

      this.doc.body.contentEditable = true;
// * end temporany fix for elrte bug on firefox */    
    } else {
        try { this.doc.designMode = "on"; } 
        catch(e) { }
        this.doc.execCommand('styleWithCSS', false, this.options.styleWithCSS);
    }

Original comment by cuorefolle@gmail.com on 10 Nov 2011 at 2:19