Tag Extractor Plugin
Extracts content between HTML-like tags with optional attributes.
import { TagExtractorPlugin } from 'simple-docs-scraper/extractors';
const extractor = new TagExtractorPlugin({
tag: 'docs',
searchAndReplace: '%docs%',
defaultText: 'No documentation found'
});
Configuration:
tag
(string): The tag name to extract content fromsearchAndReplace
(string): Replacement text for the extracted contentdefaultText
(optional): Default text when no content is foundattributeFormat
(optional): Format for tag attributes
Example usage:
<!-- Input -->
<docs>
This is documentation content.
</docs>
<!-- Output -->
This is documentation content.