fed8b2eed7
Backend release / release (push) Waiting to run
Bandit Security Scan / bandit_scan (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / build (linux/amd64, ubuntu-latest, amd64) (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Waiting to run
Build and push multi-arch DocsGPT Docker image / manifest (push) Blocked by required conditions
Build and push DocsGPT FE Docker image for development / build (linux/amd64, ubuntu-latest, amd64) (push) Waiting to run
Build and push DocsGPT FE Docker image for development / build (linux/arm64, ubuntu-24.04-arm, arm64) (push) Waiting to run
Build and push DocsGPT FE Docker image for development / manifest (push) Blocked by required conditions
Python linting / ruff (push) Waiting to run
Run python tests with pytest / Run tests and count coverage (3.12) (push) Waiting to run
React Widget Build / build (push) Waiting to run
25 lines
559 B
Python
25 lines
559 B
Python
"""HTML parser.
|
|
|
|
Contains parser for html files.
|
|
|
|
"""
|
|
from pathlib import Path
|
|
from typing import Dict, Union
|
|
|
|
from application.parser.file.base_parser import BaseParser
|
|
|
|
|
|
class HTMLParser(BaseParser):
|
|
"""HTML parser."""
|
|
|
|
def _init_parser(self) -> Dict:
|
|
"""Init parser."""
|
|
return {}
|
|
|
|
def parse_file(self, file: Path, errors: str = "ignore") -> Union[str, list[str]]:
|
|
from langchain_community.document_loaders import BSHTMLLoader
|
|
|
|
loader = BSHTMLLoader(file)
|
|
data = loader.load()
|
|
return data
|