Wrap an arbitrary html tag around a selection
|Reported by:||adamann2@…||Owned by:||fredck|
|Priority:||Normal||Milestone:||FCKeditor 2.5 Beta|
|Component:||Core : Styles||Version:|
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.
Change History (3)
comment:1 Changed 9 years ago by fredck
- Component changed from General to Core : Styles
- Milestone set to FCKeditor 2.5