Feature Proposal: Support underline and line-through text decorations

Motivation

We currently lack the ability apply underlined or line-through formatting to text in TinyMCEPlugin. Neither have native TML syntax for raw editing (which is apparently unneeded).

Users sometimes ask why there's no underline button in the WYSIWYG editor.

As for strike-through, it's useful for TODO lists and group editing some content - for ex. legal agreements.

Description and Documentation

To add official support for underline and line-through formatting in topics, there are four parts:
  1. TinyMCEPlugin.
    • It generates <span style="text-decoration: ....">foo</span> markup for underlined text.
    • It can apply <del> tags to selected text where line-through formatting is desired.
    • Need to add underline and line-through formatting buttons to the toolbar.
  2. WyswiygPlugin.
    1. HTML2TML: It must convert TinyMCE's output to and from the nominated TML markup
      • Consensus is to go with HTML 3.2 style <u> and <del> tags in the topic text.
      • The <del> tags emitted by HTML2TML should preserve the incoming class attribute in the output for the benefit of Foswiki::Merge
        • Reasons for <del> instead of <s> or <strike>:
          • <s> is undefined and <strike> is deprecated in XHTML1.0-strict, whereas <del> can pass through Foswiki::Render unchanged.
          • <del> adds semantic meaning to the text it is marking up.

            This assumes you never want line-through formatting just for its visual appearance (ie. without implying that the text is somehow not current).
    2. TML2HTML:
      1. It must convert <u> tags to <span style="text-decoration: ....">foo</span> markup for TinyMCE.
      2. It must also preserve a class attribute on the <del> tag for the benefit of Foswiki::Merge.
  3. Foswiki::Render. It has to convert our nominated TML markup into valid XHTML (strict ?) markup.
    • <u> tags should be converted into XHTML1.0-strict valid styled spans:
      • <span style="text-decoration: underline">foo</span>
      • NB: <u> is undefined in XHTML1.0-strict, but we can use it in our topics as long as Foswiki::Render converts it.
    • <del> tags can be left alone.
  4. Foswiki::Merge . It should add the class foswikiMerge to any <ins> and <del> tags that it inserts into a topic, so that they can be distinguished from user applied <del> markup, for the benefit of any conflict resolution utility that might exist in the future.

Examples

Current Proposal

Formatting Applied You write (raw): You get: Rendered as
Line through
<del>strikeout</del>
strikeout
<del>strikeout</del>
Line through + bold
*<del>strikeout</del>*
strikeout
<strong><del>strikeout</del></strong>
Underline
<u>underline</u>
underline
<span style="text-decoration: underline">underline</span>
Underline + bold
<u>underline</u>
underline
<strong><span style="text-decoration: underline">underline</span></strong>

Impact

%WHATDOESITAFFECT%
edit

Implementation

SebastianPodjasek's patch for the original -strike- syntax can be found at revision 3 of this topic.

PaulHarvey's proposal on `strike` and ~underline~ syntax can be found at revision 12 of this topic.

-- Contributors: SebastianPodjasek - 28 Sep 2009, PaulHarvey - 06 Nov 2009

Discussion

Seems useful.

Would it be better to use the <del>...</del> tags?

-- AndrewJones - 29 Sep 2009

Can possibly brake some things, as you can see below:
Line before table: =%<nop>EDITTABLE{ format="| row, -1 | text, 20, init | select, 1, one, two, three, four | radio, 3,:-),:-I,:-( | label, 0, %<nop>SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%=
%EDITTABLE{ format="| row, -1 | text, 20, init | select, 1, one, two, three, four | radio, 3,:-),:-I,:-( | label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%
|*Nr*|*Text field*|*Drop down*|*Mood*|*Timestamp*|
| 1 | hello table | one | :-) | 26 Jun 2002 12:30 |
| 2 |  | two | :-( | 27 Jun 2002 12:40 |
renders into this... LT-error-EditTablePlugin.png

-- SebastianPodjasek - 01 Oct 2009

Refactored with a new proposal, including a preliminary plan (that assumes consensus on the undebated proposal ;-). Sebastian, hope you don't mind. Comitting myself so that people will engage.

-- PaulHarvey - 06 Nov 2009

Hmmm, I'm really not keen on this. There are already too many markup funnies, and adding these two seems to me to be of doubtful value. We have survived without them for ten years, why have they suddenly become a requirement? Convince me......

Oh, and also there doesn't seem to be a rational combination of styles; what do I do if I want to strike out italic text?

-- CrawfordCurrie - 19 Nov 2009

To be honest, it's just a strange thing to have to answer "sorry, you can't underline" when it seems like a trivial thing that's been arbitrarily disabled (from the user's perspective).

I will concede that this type of thing is already currently impossible.

So: If we aren't going to have new TML, then we should formalise on <s> and <u> so I can add buttons form them in the TinyMCE editor.

CrawfordCurrie, others: should the proposal be updated so that it only affects:
  • TinyMCEPlugin's addition of line-through and underline buttons
  • WysiwygPlugin's conversion to/from <u>/<s> from/to <span style="...
  • ::Render producing XHTML that looks like <span style="text-decoration: underline" for <u> and <del> for <s>
  • Evaluation of Foswiki CSS for cross-browser consistency wrt <del>
-- PaulHarvey - 19 Nov 2009

For me it's very usefull thing to have strikeout of text - I would even say it's a "must-have" feature. I use Foswiki for sharing and editing of legal agreements and functional specifications, where it's useful to have some simple way to show user that some sentences have been disabled and are not currently in force.

-- SebastianPodjasek - 20 Nov 2009

Nobody is saying you can't have it; we are just arguing about the mechanism i.e. whether we should support TML to do it. I can use <del> or <strike> HTML tags to strikeout, and <u> HTML tags to underline. From WYSIWYG it makes no difference; but the focus of this proposal is creating new TML to support these features, and it's that I'm unhappy about. There are other text formatting features, such as superscript and subscript that arguably are used just as often, and probably should get equal billing; where do we stop?

-- CrawfordCurrie - 20 Nov 2009

I am not entirely happy with the proposed TML, either, basically for the same reasons that Crawford cites. I would prefer an HTML-based approach. I like <u> for underline; I do not have strong preferences for strikeout.

-- MichaelTempest - 20 Nov 2009

I am still licking the wounds from the change we did making numbers lower case letters in wikiwords. I drove that change and regretted. The proposed syntax will clash with normal text and it is not even intuitive. Ie not better than HTML. I would not recommend this syntax but welcomes the feature in Wysiwyg using plain HTML syntax.

-- KennethLavrsen - 20 Nov 2009

Ok, the main argument for new TML syntax I thought was avoiding unclosed or otherwise malformed HTML tags, which will be inevitable for users working without a WYSIWYG editor.

Updating the proposal to reflect the apparent consensus here.

Reset the clock as the proposal has changed substantially.

-- PaulHarvey - 21 Nov 2009

Reset the clock again after posting to foswiki-discuss. Hopefully Crawford will remove his concern or add further comments

-- PaulHarvey - 06 Dec 2009

I still have a concern re: the use of "del" tags. If the proposal were extended to add an attribute to the del tags used by Foswiki::Merge such that they could be clearly identified by any (yet to be invented) merge resolution mechanism, and protected by WysiwygPlugin, I would be happier. For example <del class="foswikiMerge">.

-- CrawfordCurrie - 07 Dec 2009

You make a valid point. I have updated the proposal with your suggestion.

-- PaulHarvey - 07 Dec 2009

I added the requirement to add the attributes in Foswiki::Merge and removed my concern.

-- CrawfordCurrie - 07 Dec 2009

AcceptedBy14DayRule, created Tasks.Item2515

-- PaulHarvey - 21 Dec 2009

Paul this has been lurking in TBD for over 2 years now, so I've added back a concern; are we ever going to plan this into a release? If we are, then simply remove my concern.

-- CrawfordCurrie - 24 Feb 2012

I came across this looking for this feature. Seems like a good idea to me. Specifically, with Drupal, limiting the allowed tags automatically strips out all "style=..." declarations, so there's no way of getting TinyMCE to use a or tag that I know of through the UI.

-- JesseHofmannSmith - 03 Mar 2012

Ha, oops. I didn't realize that the <s> and <delete> tags in the post would be literally interpreted.

-- JesseHofmannSmith - 03 Mar 2012

Using underline for anything other than links is a very bad idea.

-- ArthurClemens - 03 Mar 2012

Changing to Parked. Needs a developer.

-- GeorgeClark - 19 Nov 2015
 
Topic revision: r25 - 28 Mar 2017, CrawfordCurrie - This page was cached on 21 Nov 2017 - 05:48.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License