Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ragaeeb/shamela/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Removes anchor and hadeeth tags from the content while preserving<span> elements. This is useful for cleaning Shamela HTML while maintaining the title hierarchy information stored in span tags.
Signature
Parameters
HTML string containing various tags
Returns
The content with only span tags retained
Tags Removed
Anchor Tags (<a>)
- Removes
<a>tags but preserves the text content inside - Pattern:
/<a[^>]*>(.*?)<\/a>/gs - Example:
<a href="inr://123">text</a>→text
Hadeeth Tags
- Removes all hadeeth-related tags:
- Self-closing:
<hadeeth /> - With content:
<hadeeth>...</hadeeth> - Numbered:
<hadeeth-1>,<hadeeth-2>, etc.
- Self-closing:
- Pattern:
/<hadeeth[^>]*>|<\/hadeeth>|<hadeeth-\d+>/gs
Example
Use Cases
Preserve Title Hierarchy
Prepare for Display
Processing Pipeline
Recommended order when processing Shamela content:Complete Tag Removal
If you need to remove ALL tags including spans, usestripHtmlTags() instead:
Related Functions
stripHtmlTags()- Remove ALL HTML tagsnormalizeHtml()- Normalize hadeeth tags to spansparseContentRobust()- Parse HTML preserving title hierarchy