Forums

Plugin Request: Underline quicktag in editor (12 posts)

  1. navid
    Member
    Posted 4 years ago #

    I don't think it would take much effort to implement, but I think the main reason it has been omitted to begin with is that it's pretty bad usability to underline something that is not a link.
    Generally, if you are trying to make things standout, you bold them.

  2. solvingnormal
    Member
    Posted 4 years ago #

    I guess I'm used to underlining book titles. I suppose I can use italics, it's just not what I'm used to.

  3. Kafkaesqui
    Moderator
    Posted 4 years ago #

    And there's no PHP involved in adding your own quicktag. Ok, a little javascript knowledge helps, but it's pretty easy:
    http://www.tamba2.org.uk/wordpress/quicktags/

  4. Kafkaesqui
    Moderator
    Posted 4 years ago #

    I wouldn't recommend using <u>, though. It's a deprecated tag, and XHTML 1.0 Strict doesn't support it.

  5. macmanx
    Member
    Posted 4 years ago #

    What tags would you suggest instead?

  6. solvingnormal
    Member
    Posted 4 years ago #

    Kafkaesqui - A perfect solution! Thanks much. For any others who may wish, you can copy and paste the code below:
    edButtons[edButtons.length] =
    new edButton('ed_u'
    ,'u'
    ,'<span style="text-decoration:underline">'
    ,'</span>'
    ,'u'
    );

  7. solvingnormal
    Member
    Posted 4 years ago #

    macmanx - when the <u> tag was deprecated, the W3C suggested replacing it using the style attributes. The answer I suggested, using span with a style attribute (either coded the way I did, or with a class where you've defined the class as having the text-decoration:underline), seems to be what I've seen recommended.

  8. macmanx
    Member
    Posted 4 years ago #

    Thanks Kaf. I still feel like <u> is a lot easier ..... I hate XHTML Strict. :(

  9. Kafkaesqui
    Moderator
    Posted 4 years ago #

    Easier is not always better, but on XHTML Strict...agreed!

  10. Daisyhead
    Member
    Posted 4 years ago #

    Kafkaesqui - A perfect solution! Thanks much. For any others who may wish, you can copy and paste the code below:
    edButtons[edButtons.length] =
    new edButton('ed_u'
    ,'u'
    ,'<span style="text-decoration:underline">'
    ,'</span>'
    ,'u'
    );

    Where does one post this code? Which file? Thanks!

  11. lstelie
    Member
    Posted 4 years ago #

    @Daisyhead

    Look in wp-admin/quicktags.js

  12. navid
    Member
    Posted 4 years ago #

    If you don't want to fiddle around with quicktags.js or any of that junk, you can add:

    .underline
    {
    text-decoration: underline;
    }

    to your CSS stylesheet (e.g. style.css) and then use:

    <span class="underline">your text here</span> inside of your posts and pages.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.