Tag Filter in the HTML6 Editor
Need to extract or remove specific tags from your HTML? Use the tag filter panel in the HTML6 editor! Just enter a tag name, specify attributes or content, and execute the command with the triangle icon: ➤
The code will be extracted to the Draft Editor📝 when you choose the extract option.
How to Use the Tag Filter?
Set up the filtering process by setting the following input fields, to compose a valid English sentence:
For example:
Ectract "a" tags and contents which don't contain nofollow attributes.
1. Extract or Delete – Choose whether you want to extract the matching tags to the Draft Editor or delete them from the main editor.
2. Specify Which Tag – Enter the tag name you want to filter. For example, img for images or a for links. Leaving this field empty applies the filter to all tags.
3. Select Which Part of Element – Define which part of the element you want to work with.
Tag – The opening and closing tags, enclosed in < and >.
Attributes – The section in the opening tag that contains styles, class names, etc.
Contents – The inner text or data between the opening and closing tags. Self-closing tags like img or br do not have content.
Tag + Content – The entire element, including both the tag and its content.
Optional Values:
4. Contains or Doesn't – Optionally, negate the filter condition.
5. Filter Text – Enter a string to filter by. If left empty, the filter applies to all matching elements.
6. Attribute or Content – Specify whether the filter should check within attributes or content.
Tips for Better Tag Filtering
- Be careful when deleting tags, especially structural elements like div and span.
- Filter by attributes to target elements with specific styles, IDs, or classes.
- Combine multiple filters for more refined results.
Examples
👉 Extract all tag+cont (which contain any attributes)
Extracts all tags and their contents, regardless of their attributes. Please note that for the example below it extracts the h3 and then the strong tag inside of it.
<h3>This is <strong>a test</strong></h3>Extracts this:
<h3>This is <strong>a test</strong></h3> <strong>a test</strong>
👉 Extract img tags (which contain alt="" attributes)
Lists the image tags that have empty alt attributes.