WordPress.org

Ready to get started?Download WordPress

Forums

Quotation marks in Tiny MCE (7 posts)

  1. anapest
    Member
    Posted 1 year ago #

    When I insert this piece of code into Tiny MCE:

    <div id="info"><abbr title="Blabla: blablabla.">Bla</abbr></div>

    Everything is OK.
    But when I try to insert this:

    <div id="info"><abbr title="<strong>Blabla:</strong> blablabla.">Bla</abbr></div>

    I get this:

    <div id="info"><abbr title="<strong>Blabla:</strong> blablabla.»>Bla</abbr></div></blockquote>

    How can I get rid of » and have simple " ?

    P.S. In fact I get ampersand#187 but the editor in this WordPress.org page changed it into &raquo.

    P.S.2 It's strange that the same editor in this page, by its own accord, insert another blockquote tag in the end of this post... It's a very unruly editor. :(

  2. Timothy Jacobs
    Member
    Posted 1 year ago #

    HTML does not allow you to style title attributes. It seems like the wordpress editor is trying to make sense of your input, and well it obviously didn't work. What were you trying to achieve with the <strong> tags.

  3. anapest
    Member
    Posted 1 year ago #

    Hello, Timothy! I am trying to implement mobile friendly tooltips (css+jquery). Just look here http://osvaldas.info/examples/elegant-css-and-jquery-tooltip-responsive-mobile-friendly/ and you'll see that HTML does allow style title attributes (italics used in the text of a tooltip as you can see on the demo page). The solution by Osvaldas Valutis works for me nicely on a usual html site but I can't use it in WP because of TinyMCE's pranks.

    I need some rather lengthy tooltips on a few of my pages (additional information for specialists) and I would like them to be styled like this: Volume: blabla... Recommended for: blabla etc.

  4. anapest
    Member
    Posted 1 year ago #

    Hooray! RawHtml plugin did the trick!

  5. Timothy Jacobs
    Member
    Posted 1 year ago #

    Hey Anapest, glad to see you found a solution, but what I am trying to say is that putting styles in the title attribute is not what TinyMCE would expect as valid HTML because on its own the browser will just see it as "Blabla: blablabla." ie, if you disable javascript that will be what you will see when you hover over to. The jquery plugin is just taking the styles that are present under that attribute, and if you look at the code you will see that it is then just creating a div element with the html from the title attribute and positioning it relative to where the link appears, and then removing the tool tip. So TinyMCE tries to convert those characters into there html equivalents, because it doesn't know about the jQuery plugin and knows that the html will appear as text.

  6. anapest
    Member
    Posted 1 year ago #

    Thank you for this explanation, Timothy. Surely you have a point. By the way, do you think it would be better to avoid any jquery things on websites because some users may have javascript disabled?

  7. Timothy Jacobs
    Member
    Posted 1 year ago #

    God no. JQuery is a fantastic design tool, but it should only be used as a design tool. i.e. you should make sure that if javascript is disabled that your site still functions properly.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.