View Single Post
Old 10-30-2022, 12:40 AM   #15
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,180
Karma: 1988646
Join Date: Aug 2015
Device: Kindle
You can use the Editor Chains plugin to do this. But it is going to be two part process
  1. Mark the tag(s) you want to remove. (Using the first chain attached below).
    This chain will mark tags by adding an attribute to them. First bind the chain to whatever keyboard shortcut you want. After that you can start marking the tags you want to act on. All you need is to have the cursor somewhere inside the tag before clicking the keyboard shortcut.
  2. Run the second chain to make the necessary changes to the tags you previously marked.

Also you can merge adjacent italic tags into one. You can find an example for that in the plugin's thread. It will need modifying to change the name form <span> to <i>.

Notes:
  • To import the chains. go to Editor Chains > Add/modify chains > right click on table > import chain.
  • To bind a chain to a keyboard shortcut. go to Editor Chains > Add/modify chains > Keyboard shortcuts.
  • The first action of the second chain will add a class name "italic" to the parent tag. If you don't want that, edit the chain to remove it.
  • In your case we are already unwrapping the <i> tag, so the marks will go away as will. In other scenarios, we need to add an action to the second chain to remove the marking attribute; I added it anyway as it does not hurt.
  • The "Mark Tag" of the plugin is configurable. So you can make as many mark chains as you want to use for different purposes
Attached Files
File Type: zip mark tag.zip (360 Bytes, 212 views)
File Type: zip Unwrap marked.zip (810 Bytes, 194 views)
capink is offline   Reply With Quote