Hi,

I prefer using [b] than [strong], so I put [b] as html coding, and when I validate my post, those [b] are changed in [strong].
Any way workaround?

Thanks

Comments

Tobias Maier’s picture

<b> is DEPRECATED

so dont use it anymore it is not part of xhtml
use <strong> instead

<i> was replaced by <em>

so if some module changes <b> to <strong> this is just good!

Julien PHAM’s picture

Really? I didn't know... but I read somewhere < b > and < strong > do not do the same thing, because < b > really put the text in bold, and strong... does the same for now, but in fact it highlights the text, so if someday a browser decides that a text in strong mode should be in yellow for example, our "bold" text will not be bold anymore but in yellow...

gushie’s picture

Googling around there is a difference. One site said that screen readers may treat them differently. I think it's fair to say however, that any webbrowser that decides to make a strong tag bright yellow is probably not to going to gain widespread support!

So basically, <b> and <i> are just cosmetic, i.e. like using <font color=...> or css.

However <strong> and <em> are used to change the context of the message. I.e. imagine if you were reading it out loud and decide whether you would add extra emphasis or volume to these particular words. If you would, strong and em are the way to go.

Heine’s picture

Are you sure? I don't believe <b> and </i> are deprecated (see XHTML Abstract Modules).

<strong> and <em> say nothing about markup, so claiming that they replace <b> and <i> is a bit far fetched.
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

Rob_Feature’s picture

YES! both of them are depreciated in favor of <strong> and <em>. The reason, as stated above, is because XHTML is further trying to separate content from style. <strong> and <em> are sematic markup, while <b> and <i> are styles put into the XHTML.

/**
  * Bob Christenson
  * Mustardseed Media
  * http://mustardseedmedia.com
  */
Senpai’s picture

My problem right now is the exact opposite. I've got a fresh tinymce install on Drupal 4.7, and tinymce seems to be changing all my carefully crafted [strong] tags to [b] tags upon each submit. Where's the setting to make it stop countermanding me? ;0

Yes, I do have a custom html filter set up especially for "content contributors", and the [strong] tag is allowed in that one, whereas it's not in the default one.

****
Joel "Senpai" Farris | certified to rock score

j.m.’s picture

Hi,

I have also the same problem. And the answer as far as I know is: Yes it's tinyMCE that use strong when you click on the bold (b) button. I am using tinyMCE version 2.1.0 and Drupal 5.1.

By the way for all people that don't see this as a problem, please take not that I have received a note from google today that my site contains too many "<p><strong>". The strong tag is actually important in indexing and should be only used once in a while per page.

To be fully compatible with everything, tinyMCE should be using style="" in div or p tags... because overwriting all other CSS style and changing the look of the text is what we want to acheive.

But it's more a tinyMCE issue than Drupal...

j.m.’s picture

Here's an ugly hack to fix it:

  • open tiny_mce.js from sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/
  • Change -strong/-b[class|style]
  • For -b[class|style]/-strong

It will replace all strong tags with b tags. TinyMCE will change _every_ tags, so if you want to really use strong tag again, just edit it in plain text in drupal without enabling tinymce.

Rob_Feature’s picture

No offence intended, but this isn't a 'problem'. This is the correct way to write code. All of your styling info should be in your style sheets. If TinyMCE is putting style tags into your code, it's a problem for future compatibility.

To be honest, do it right now, or re-do everything in a few years when you want it to be compatible with the rest of the world (which will be running XML).

/**
  * Bob Christenson
  * Mustardseed Media
  * http://mustardseedmedia.com
  */
j.m.’s picture

Google looks for strong and em, and if you have too many of them on one page they won't index you properly. On the other side, my users really like to use bold.. but I agree with you on the styling.

Maybe I should tie the bold button on TinyMCE to a style not a specfic tag... something like a div with a class that just adds bold. I'm open to "clean" suggestions.

My only concern for now with this is not having too much strong tags on my page and keep the users happy.