• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4588: Bold italic does not work in TinyMCEPlugin

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension TinyMCEPlugin Normal Closed   minor  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Bold italics does not seem to work in the new TinyMCEPlugin:

I entered the text in quotes " *here is the text in quotes* " as bold italic. Note that it is not the quotes that matter, as you can see from the text up to the preceeding word "text"

To reproduce you have to do the following:

  1. Click on "italics"
  2. Type the text
  3. Select the italic text and click on "bold"
    • Now you will see the text in bold italic
  4. Save

If you click on both bold and italic before typing the text, everything is fine, as the text between the commas shows. But after the fact bolding and italizing also works, just not the procedure described above.

-- TWiki:Main/ThomasWeigert - 09 Sep 2007

Trying italics first then bold out.... ok that worked, how about bold first then italics

That was also fine. Check out Thomas' exact procedure above:

here is the text in quotes

That was also fine. Follow the same procedure but this time with the *'s in case they were meant as literal:

" **here is the text in quotes** "

What we have here is a case of interleaved highlight, which is documented as a known bug with the translator (actually it's a known bug with TML, but who's counting). What happens is this.

When you open the italics, all text typed after that will be in italics. So if you type

" 
then turn on italics, then type
*here is the text in italics* "
you will note that the closing quote is also italicised. The HTML equivalent is
" _*here is the text in quotes* "_
Now, when you add bold to the text, you get this:
" _**here is the text in quotes** "_
As you can see, while the opening
<b><i>
is recognisable to the translator as a sequence that opens bold italic, the matching closing </b> and </i> are separated by a space and a quote. So the translator can't generate bold italic. It should be able to generate bold (using the <b>) but it appears to be being confused by the inner *'s (which should block it from using TML escapes)

I will add a testcase for this, but I'm somewhat concerned that finding a general solution may be impossible. TML makes life very, very difficult by using symmetric quote characters (using a * for both ends of a bolded sentence, for example).

CC

Yes that is what I feared. However, I was seeing this problem also with text that was not in quotes, see above. It seems to quite tricky to make a selection that ends up matching the italics. However, the text is shown in bold italic in the editor, so I wonder whether there is something we can do in validating the translation (e.g., if a text is started with _*, don't end it with *_, or put extra space there, etc.

Experiments:

1. abc here is the text and now we continue normal

2. abc here is the text and now we continue normal

3. abc here is the text and now we continue normal

4. abc here is the text and now we continue normal

In (1) I had the italics including the space thereafter, and the bold including the space thereafter. In (2) I had the italics not including the space thereafter, but the bold including the space. In (3) I had the italics including the space thereafter, but not the bold. In (4) I had neither the italics nor the bold including the space.

As you can see, the translation is incredibly sensitive to the selection. In particular, I am puzzled about (1), which seemed to make the same selection but failed nevertheless. It appears that you must exactly select text, no surrounding whitespace, or anything else, if you apply formatting to already formatted text. This appears not to be a problem if you apply formatting to non-formatted text:

5. abc here is the text and now we continue normal

6. abc here is the text and now we continue normal

7. abc here is the text and now we continue normal

8. abc here is the text and now we continue normal

-- ThomasWeigert - 09 Sep 2007

Oh, that sort of validation is already done. That's what I meant when I said it should be able. As you have noted the rules are horrendously sensitive, though, which makes it quite tricky.

-- TWiki:Main.CrawfordCurrie - 09 Sep 2007

If you can give me the HTML that TinyMCE generates for each testcase, I can add the cases to the translator tests and work on them. You can see the HTML by clicking on the 'HTML' button in the toolbar.

-- TWiki:Main.CrawfordCurrie - 10 Sep 2007

I improved the code the does the detection, so repeating your tests we get:

  1. abc here is the text and now we continue normal
  2. abc here is the text and now we continue normal
  3. abc here is the text and now we continue normal
  4. abc here is the text and now we continue normal
CC

ItemTemplate
Summary Bold italic does not work in TinyMCEPlugin
ReportedBy TWiki:Main.ThomasWeigert
Codebase

SVN Range TWiki-4.2.0, Sat, 08 Sep 2007, build 14780
AppliesTo Extension
Component TinyMCEPlugin
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:14837
TargetRelease minor
ReleasedIn

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r7 - 2007-09-12 - CrawfordCurrie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback