Overview
Introduction
Undoing a wrapping operation, stripping brackets, parentheses, or custom markers back off a list, is the natural companion to adding them.
This tool strips a chosen prefix and suffix from every list item, reversing what List Item Wrapper adds.
What Is List Item Unwrapper?
A list transformer that removes a matching prefix string and suffix string from each item, when both are present.
It's worth noting this is unrelated to the string category's Line Unwrapper, which joins soft-wrapped paragraph lines back together, a completely different operation that happens to share part of its name.
How List Item Unwrapper Works
The list is split into items using the resolved separator, and each item is checked for the exact prefix at its start and the exact suffix at its end.
If both are present, they're stripped with `String.prototype.slice()`; otherwise the item passes through unchanged, and the result is rejoined using the list separator.
When To Use List Item Unwrapper
Use it to undo a previous List Item Wrapper pass, removing brackets, parentheses, or other markers you added earlier.
It's also useful for cleaning up a list where every item shares the same known wrapping text that you want stripped out.
Often used alongside List Item Wrapper, List Item Unquoter and List Item Bullet Remover.
Features
Advantages
- Directly reverses List Item Wrapper's output with matching settings.
- Safe on mixed lists, only items with both the exact prefix and suffix are modified.
- Supports prefix-only or suffix-only stripping if that's all you need.
Limitations
- Requires an exact, case-sensitive match for both the prefix and suffix; partial or approximate matches are not stripped.
- Does not detect or guess the wrapping text automatically, you must know and enter it.
- Unrelated to the string category's Line Unwrapper despite the similar name, so don't expect paragraph-joining behavior here.
Examples
Best Practices & Notes
Best Practices
- Enter the exact prefix and suffix text you used when wrapping, including any spaces, to ensure a full match.
- Use List Item Unquoter instead if the wrapping characters are matching quote marks rather than arbitrary text.
- Double-check items that were left unmodified, since a mismatched or partial wrapping string prevents stripping.
Developer Notes
Implemented by checking `item.startsWith(prefix) && item.endsWith(suffix)` (with a length guard to avoid overlapping matches on very short items), then using `String.prototype.slice(prefix.length, item.length - suffix.length)` to remove both; note this is unrelated to the string category's paragraph-joining `line-unwrapper`, despite the similar name.
List Item Unwrapper Use Cases
- Reversing a previous List Item Wrapper pass to recover the original plain items
- Stripping a known bracket or marker pattern from every item in a pasted list
- Cleaning up list items exported with consistent surrounding text you don't need
Common Mistakes
- Confusing this with the string category's Line Unwrapper, which does unrelated paragraph-joining, not prefix/suffix stripping.
- Entering a prefix or suffix that doesn't exactly match the item's text (including whitespace), causing the item to be skipped.
- Leaving both prefix and suffix empty, which the tool rejects since there's nothing to strip.
Tips
- Use the same prefix and suffix values you used in List Item Wrapper to cleanly reverse that operation.
- Check for a stray leftover half-wrapped item in the output, it's a sign the prefix or suffix didn't exactly match that item.