get_heading_text
Extracts the text content from a BeautifulSoup Tag object, removing paragraph symbols, stripping whitespace, and replacing newlines with spaces.
def get_heading_text(
heading: Tag
) - > string
Extracts and cleans the text content from a BeautifulSoup Tag object by removing paragraph symbols, stripping whitespace, and normalizing newlines.
Parameters
| Name | Type | Description |
|---|---|---|
| heading | Tag | The BeautifulSoup Tag object representing an HTML heading element to be processed. |
Returns
| Type | Description |
|---|---|
string | The sanitized heading text with paragraph markers removed and internal newlines replaced by spaces. |