﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
207	Wrap an arbitrary html tag around a selection	adamann2@…	Frederico Caldeira Knabben	"I would like to request a feature that would wrap html tags, with attributes, around a user's selection.  For instance, if the user selects some text in the edit pane and presses a button, I want to wrap the selection in a span, with a class and title.  We need this feature for adding instructor comments to student writing assignments.

I have found and tried several examples, and they work fine as long as the selection is just text.  However, to be useful, the inserted tags need to work properly with other tags in the text.

A simple example, starting with this:

<p>Here's some text</p>
<p>Here's some more text</p>

Now, if the user's selection starts with the word 'text' in the first paragraph, and ends with the word 'more' in the second paragraph, here's what I'd expect to see:

<p>Here's some <span class=""foo"" title=""bar"">text</span></p>
<p><span class=""foo"" title=""bar"">Here's some more</span> text</p>

What I'm actually getting with the examples I've tried is something like this:

<p>Here's some <span class=""foo"" title=""bar"">textHere's some more</span> text</p>

I'd be happy to help work on this, if someone can help me out or point me in the right direction, or let me know anyone is already working on something similar."	New Feature	closed	Normal	FCKeditor 2.5 Beta	Core : Styles		fixed		
